Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from docker/feat-add-failure-notifications
Browse files Browse the repository at this point in the history
feat: add action failure notifications
  • Loading branch information
mrjoelkamp authored Jul 24, 2024
2 parents 1d7ac96 + 6e2a7bf commit e674795
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@ jobs:
destination: docker://docker/tuf-targets
tuf-root: prod
flags: "-f"
failure-notification:
runs-on: ubuntu-latest
needs: [mirror]
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: failure
MSG_MINIMAL: true
SLACK_TITLE: "${{ github.workflow }} - Failure"
SLACK_MESSAGE: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_FOOTER: "triggered by ${{ github.repository }}"
18 changes: 16 additions & 2 deletions .github/workflows/online-sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ permissions: {}

on:
schedule:
- cron: '17 1,7,13,19 * * *'
- cron: "17 1,7,13,19 * * *"
push:
branches: [main]
paths:
['metadata/**', '!metadata/timestamp.json', '!metadata/snapshot.json']
["metadata/**", "!metadata/timestamp.json", "!metadata/snapshot.json"]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -51,3 +51,17 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}
success: ${{ !contains(needs.*.result, 'failure') }}
failure-notification:
runs-on: ubuntu-latest
needs: [online-sign, update-issue]
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: failure
MSG_MINIMAL: true
SLACK_TITLE: "${{ github.workflow }} - Failure"
SLACK_MESSAGE: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_FOOTER: "triggered by ${{ github.repository }}"
14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}
success: ${{ !contains(needs.*.result, 'failure') }}
failure-notification:
runs-on: ubuntu-latest
needs: [build, deploy-to-pages, test-deployed-repository, update-issue]
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: failure
MSG_MINIMAL: true
SLACK_TITLE: "${{ github.workflow }} - Failure"
SLACK_MESSAGE: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_FOOTER: "triggered by ${{ github.repository }}"

0 comments on commit e674795

Please sign in to comment.