WF run ~ Send notification to slack for failed post-merge workflows #1531
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
# (C) 2024 GoodData Corporation | |
name: WF run ~ Send notification to slack for failed post-merge workflows | |
on: | |
workflow_run: | |
workflows: ["Push ~ Build web component's container image"] | |
types: [completed] | |
branches: ["master", "release", "hotfix/tiger", "hotfix/panther", "fast_track"] | |
jobs: | |
notify-post-merge-failed-to-slack: | |
runs-on: | |
group: infra1-runners-arc | |
labels: runners-small | |
steps: | |
- name: Inform to slack when post-merge workflows failed | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
uses: slackapi/[email protected] | |
with: | |
channel-id: '#javascript-notifications' | |
slack-message: ":robot_panic: `post-merge github workflows` in `${{ github.event.repository.name }}` encountered an error during execution, check the *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}|log here>* for further information" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |