ci: alert #alerts-github on CI and Release failures#505
Closed
solvemproblr wants to merge 1 commit into
Closed
Conversation
Co-authored-by: Asadullo Ganiev <solvemproblr@users.noreply.github.com>
Comment on lines
+15
to
+26
| if: >- | ||
| github.event.workflow_run.conclusion == 'failure' && | ||
| github.event.workflow_run.event != 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Post failure to Slack | ||
| uses: slackapi/slack-github-action@v2 | ||
| with: | ||
| webhook: ${{ secrets.SLACK_ALERTS_WEBHOOK_URL }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| text: ":rotating_light: *${{ github.event.workflow_run.name }}* failed in `${{ github.repository }}` on `${{ github.event.workflow_run.head_branch }}` (triggered by ${{ github.event.workflow_run.actor.login }})\n<${{ github.event.workflow_run.html_url }}|View failed run>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
Slack Alertsworkflow (HUD-2232) that posts to the#alerts-githubSlack channel when a monitored workflow fails.workflow_runon completion ofCIandRelease.main, releases, and manual dispatches. Pull request CI failures are intentionally excluded — those are already visible on the PR itself.slackapi/slack-github-actionusing a Slack incoming webhook, so alerting is fully independent of the HUD platform.Required setup (one-time, org-level)
#alerts-github.SLACK_ALERTS_WEBHOOK_URL— ideally at the org level so other repos can reuse it.Extending to staging/prod deploys
The staging/prod deploy workflows live in the platform repo, not here. Copy this same file there and swap the
workflows:list to the deploy workflow names (e.g.[Deploy Staging, Deploy Prod]). With an org-level secret, no other changes are needed.Testing
actionlint(clean).SLACK_ALERTS_WEBHOOK_URLsecret and a real failed run onmain.Linear Issue: HUD-2232