Skip to content

Workflow Failure Alerts #9555

Workflow Failure Alerts

Workflow Failure Alerts #9555

name: Workflow Failure Alerts
on:
workflow_run:
workflows:
- Daily Hive Report
- Daily Lines of Code Report
- Daily Snapsync Check
- L1
- L2 (SP1 Backend)
- L2 (without proving)
- L2 Prover
- L2 Prover (TDX)
- L2 TDX build
- LEVM
- Publish Docker
- Publish Ethrex docs to https://docs.ethrex.xyz/
branches:
- main
types:
- completed
permissions:
contents: read
actions: read
jobs:
notify-on-failure:
name: Notify Slack on failure (main)
runs-on: ubuntu-latest
# `cancelled` runs are deliberately not alerted: a manually cancelled run
# on main is not a CI failure.
if: >-
${{ contains(fromJSON('["failure", "timed_out", "startup_failure"]'), github.event.workflow_run.conclusion) &&
(github.event.workflow_run.event == 'push' ||
github.event.workflow_run.event == 'schedule') }}
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Collect failed jobs
id: failed_jobs
uses: actions/github-script@v8
with:
result-encoding: string
script: |
const collectFailedJobs = require('./scripts/collect_failed_jobs');
await collectFailedJobs({ github, core, context });
- name: Post failure to Slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.ETHREX_INTERNO_SLACK_WEBHOOK }}
REPO: ${{ github.repository }}
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
CONCLUSION: ${{ github.event.workflow_run.conclusion }}
EVENT: ${{ github.event.workflow_run.event }}
RUN_HTML_URL: ${{ github.event.workflow_run.html_url }}
RUN_ID: ${{ github.event.workflow_run.id }}
RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
FAILED_JOBS: ${{ steps.failed_jobs.outputs.summary }}
run: |
bash .github/scripts/notify_workflow_failure.sh