Skip to content

Commit b39ba65

Browse files
committed
add slack notification if doc generation fails
1 parent 61fcc19 commit b39ba65

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/generate-go-docs.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,43 @@ jobs:
127127
title: "Go docs for PR#${{ github.event.pull_request.number }}"
128128
body: "This PR contains automatically generated go documentation for the PR#${{ github.event.pull_request.number }}. Please review the changes."
129129
commit-message: "[Bot] Add automatically generated go documentation"
130+
131+
- name: Send Slack notification
132+
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
133+
if: failure()
134+
id: slack
135+
env:
136+
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
137+
with:
138+
channel-id: 'C049X3353K2'
139+
payload: |
140+
{
141+
"attachments": [
142+
{
143+
"color": "#C62828",
144+
"blocks": [
145+
{
146+
"type": "section",
147+
"text": {
148+
"type": "mrkdwn",
149+
"text": "Go doc generation - Failed :x:"
150+
}
151+
},
152+
{
153+
"type": "section",
154+
"text": {
155+
"type": "mrkdwn",
156+
"text": "<@U060CGGPY8H>, please have a look."
157+
}
158+
},
159+
{
160+
"type": "section",
161+
"text": {
162+
"type": "mrkdwn",
163+
"text": "<${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}|PR#${{ github.event.pull_request.number }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
164+
}
165+
}
166+
]
167+
}
168+
]
169+
}

0 commit comments

Comments
 (0)