Skip to content

Commit

Permalink
chore(ci): notify in Slack if scheduled CI run fails (#560)
Browse files Browse the repository at this point in the history
Posts notices to our team alert Slack channel about any failure of a
scheduled run (read: not manually triggered or from a PR).
  • Loading branch information
jharley authored Oct 10, 2024
1 parent 59b9cb7 commit d144846
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ jobs:
-iocopy \
-out provider-report.xml
- name: Notify if scheduled run fails
id: slack-notify
if: ${{ failure() && github.event_name == 'schedule' }}
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"username": "Terraform Provider CI",
"text": ":rotating_light: The scheduled test suite run failed for the US region.\n\n<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>",
"icon_emoji": ":terraform-fall-down:"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Cleanup Dangling Resources
if: ${{ always() }}
timeout-minutes: 5
Expand Down Expand Up @@ -191,6 +205,20 @@ jobs:
-iocopy \
-out provider-report.xml
- name: Notify if scheduled run fails
id: slack-notify
if: ${{ failure() && github.event_name == 'schedule' }}
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"username": "Terraform Provider CI",
"text": ":rotating_light: The scheduled test suite run failed for the EU region.\n\n<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>",
"icon_emoji": ":terraform-fall-down:"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Cleanup Dangling Resources
if: ${{ always() }}
timeout-minutes: 5
Expand All @@ -203,7 +231,7 @@ jobs:
run: make sweep

- name: Generate Test Summary
if: always()
if: ${{ always() }}
uses: test-summary/action@v2
with:
paths: "*-report.xml"
Expand Down

0 comments on commit d144846

Please sign in to comment.