diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index 209be0b93..386571e5a 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -26,3 +26,20 @@ jobs: - name: Test with tox run: | tox -e int + + - name: Notify on failure + if: ${{ failure() }} + env: + ZULIP_BOT_CREDENTIALS: ${{ secrets.ZULIP_BOT_CREDENTIALS }} + run: | + if [ -z "${ZULIP_BOT_CREDENTIALS}" ]; then + echo "Skipping notify, ZULIP_BOT_CREDENTIALS is unset" + exit 0 + fi + + curl -X POST https://beets.zulipchat.com/api/v1/messages \ + -u "${ZULIP_BOT_CREDENTIALS}" \ + -d "type=stream" \ + -d "to=github" \ + -d "subject=${GITHUB_WORKFLOW} - $(date -u +%Y-%m-%d)" \ + -d "content=[${GITHUB_WORKFLOW}#${GITHUB_RUN_NUMBER}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) failed."