Skip to content

Commit 101f03c

Browse files
authored
ci: alert Slack on release failure (#6)
1 parent 499862a commit 101f03c

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎.github/workflows/build-release.yaml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,31 @@ jobs:
102102
uses: pypa/gh-action-pypi-publish@release/v1
103103
with:
104104
password: ${{ steps.mint-token.outputs.api-token }}
105+
106+
notify-failure:
107+
needs: [build, release, publish]
108+
if: failure()
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Notify Slack on release failure
112+
uses: slackapi/slack-github-action@v2.1.0
113+
with:
114+
errors: true
115+
webhook: ${{ secrets.PLATFORM_INCIDENT_SLACK_CHANNEL_WEBHOOK }}
116+
webhook-type: incoming-webhook
117+
payload: |
118+
text: ":rotating_light: Release failed in ${{ github.repository }}"
119+
blocks:
120+
- type: section
121+
text:
122+
type: mrkdwn
123+
text: |
124+
:rotating_light: *Release failed:* `${{ github.repository }}`
125+
*Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>
126+
- type: actions
127+
elements:
128+
- type: button
129+
text:
130+
type: plain_text
131+
text: "View failed run"
132+
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 commit comments

Comments
 (0)