Skip to content

chore: promote release hardening to main #285

chore: promote release hardening to main

chore: promote release hardening to main #285

name: CI Failure Alert

Check failure on line 1 in .github/workflows/ci-failure-alert.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-failure-alert.yml

Invalid workflow file

(Line: 15, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DISCORD_WEBHOOK != ''
on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
jobs:
alert:
if: github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
steps:
- name: Discord notification
if: secrets.DISCORD_WEBHOOK != ''
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
PAYLOAD=$(cat << 'EOF'
{
"content": "⚠️ **CI Failure on main**\nRepository: `${{ github.repository }}`\nWorkflow: `${{ github.event.workflow_run.name }}`\nConclusion: `${{ github.event.workflow_run.conclusion }}`\nRun: ${{ github.event.workflow_run.html_url }}\nCommit: `${{ github.event.workflow_run.head_commit.message }}`\nAuthor: ${{ github.event.workflow_run.actor.login }}"
}
EOF
)
curl -s -H "Content-Type: application/json" -d "$PAYLOAD" "$DISCORD_WEBHOOK"