Skip to content

Commit

Permalink
Merge pull request #153 from Agoric/rs-slack-alerts-for-e2e-tests
Browse files Browse the repository at this point in the history
feat: alert slack if e2e tests fail
  • Loading branch information
rabi-siddique authored Jun 14, 2024
2 parents 17b52d4 + da5c4c0 commit 880b6d3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/actions/notify-status/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Notify GitHub Actions Status on Slack
description: Notify Slack about the status of GitHub Actions jobs

inputs:
webhook:
description: 'Slack Webhook URL to send the alerts'
required: true

runs:
using: composite
steps:
- name: Send GitHub Actions Status to Slack
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"text": "Job ${{ github.job }} in workflow ${{ github.workflow }} of repository ${{ github.repository }} has a status of ${{ job.status }}.\nDetails: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"username": "GitHub Actions"
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.webhook }}
9 changes: 9 additions & 0 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ jobs:
tests/e2e/docker/videos-ci
tests/e2e/docker/screenshots
continue-on-error: true

- name: Notify About Failure
if: >
failure() && github.event_name != 'pull_request' &&
github.repository_owner == 'agoric'
uses: ./.github/actions/notify-action.yml
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
continue-on-error: true

0 comments on commit 880b6d3

Please sign in to comment.