fail-notify #45195
This file contains 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
--- | |
name: fail-notify | |
on: | |
workflow_run: | |
workflows: | |
- Add to Task List | |
- CodeQL | |
- 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/[email protected] | |
- name: Get slack payload | |
id: get_slack_payload | |
uses: actions/[email protected] | |
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/[email protected] | |
with: | |
channel-id: ${{secrets.SLACK_CHANNEL_ID}} | |
payload: ${{steps.get_slack_payload.outputs.result}} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |