Notify Zulip chat on integration test failure
@@ -25,3 +25,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=general" \
+ -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."
