File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464 PYBATFISH_PYPI_TOKEN : ${{ secrets.PYBATFISH_PYPI_TOKEN }}
6565 BATFISH_DOCKER_LOGIN_TOKEN : ${{ secrets.BATFISH_DOCKER_LOGIN_TOKEN }}
6666 OPEN_SOURCE_BUILDKITEBOT_PUBLIC_REPO_TOKEN : ${{ secrets.OPEN_SOURCE_BUILDKITEBOT_PUBLIC_REPO_TOKEN }}
67+
68+ # Send Slack notification on failure for scheduled or post-merge jobs on master branch
69+ notify_slack_on_failure :
70+ needs :
71+ - precommit
72+ - test
73+ - upload
74+ if : |
75+ always()
76+ # failure() &&
77+ # github.ref == 'refs/heads/master' &&
78+ # (github.event_name == 'schedule' || github.event_name == 'push') &&
79+ # !(github.event_name == 'workflow_dispatch' || github.event.schedule == '0 15 * * *')
80+ runs-on : ubuntu-latest
81+ steps :
82+ - name : Send Slack notification
83+ uses : slackapi/slack-github-action@v2.1.0
84+ with :
85+ webhook : ${{ secrets.SLACK_WEBHOOK_URL }}
86+ webhook-type : incoming-webhook
87+ payload : |
88+ {
89+ "text": "*Docker cross-version tests and upload workflow failed*",
90+ "blocks": [
91+ {
92+ "type": "section",
93+ "text": {
94+ "type": "mrkdwn",
95+ "text": "*Docker cross-version tests and upload workflow failed*"
96+ }
97+ },
98+ {
99+ "type": "section",
100+ "fields": [
101+ {
102+ "type": "mrkdwn",
103+ "text": "*Workflow:*\nDocker cross-version tests and upload"
104+ },
105+ {
106+ "type": "mrkdwn",
107+ "text": "*Status:*\nFailed"
108+ },
109+ {
110+ "type": "mrkdwn",
111+ "text": "*Trigger:*\n${{ github.event_name }}"
112+ },
113+ {
114+ "type": "mrkdwn",
115+ "text": "*Branch:*\nmaster"
116+ }
117+ ]
118+ },
119+ {
120+ "type": "actions",
121+ "elements": [
122+ {
123+ "type": "button",
124+ "text": {
125+ "type": "plain_text",
126+ "text": "View Workflow Run in GitHub Actions"
127+ },
128+ "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
129+ }
130+ ]
131+ }
132+ ]
133+ }
You can’t perform that action at this time.
0 commit comments