Skip to content

fail-notify

fail-notify #57048

Workflow file for this run

---
name: fail-notify
on:
workflow_run:
workflows:
- Add to Task List
- Dependency Review
- fix-fail-notify
- format-json-yml
- gcr-cleaner
- github-actions-cache-cleaner
- release
- remove-app-engine-versions
- resource-update
- super-linter
- update-gitleaks
types:
- completed
permissions: read-all
jobs:
fail-notify:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'failure'
steps:
- uses: actions/checkout@v4.2.0
- name: Get slack payload
id: get_slack_payload
uses: actions/github-script@v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/fail_notify/fail_notify/get_slack_payload.js`)
return script({context})
- uses: slackapi/slack-github-action@v1.27.0
with:
channel-id: ${{secrets.SLACK_CHANNEL_ID}}
payload: ${{steps.get_slack_payload.outputs.result}}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}