Skip to content

Commit

Permalink
notify docs matrix channel on docs build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
oraNod committed Jun 25, 2024
1 parent a732a1e commit 7b290eb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-package-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@ jobs:
path: build-directory/docs/docsite/ansible-package-docs-html-*.tar.gz
retention-days: 7

notify-build-failures:
if: failure()
needs: build-package-docs
runs-on: ubuntu-latest
env:
ROOM_URL: https://ansible-accounts.ems.host/_matrix/client/v3/rooms/!HJtetIFWYEIDBOXxFE:libera.chat/send/m.room.message
FAIL_MESSAGE: >-
This is a notification from the community package publishing workflow.
The community package docs build has failed.
@orandon @samccann
steps:
- name: Set a transaction ID
run: echo "TX_ID=$(date +%s)" >> "${GITHUB_ENV}"

- name: Notify the DaWGs in Matrix
run: |
curl -X PUT "${{ env.ROOM_URL }}/${TX_ID}" \
-H "Authorization: Bearer ${{ secrets.DOCS_BOT_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"msgtype": "m.text", "body": "${{ env.FAIL_MESSAGE }}"}'
deploy-package-docs:
if: fromJSON(github.event.inputs.deploy)
needs: build-package-docs
Expand Down

0 comments on commit 7b290eb

Please sign in to comment.