Skip to content

Commit a7507e8

Browse files
committed
adding slack alert part on CI/CD
1 parent 78f07be commit a7507e8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/npm-publish.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,26 @@ jobs:
2727
- run: npm install
2828
- run: npm publish --access public
2929
env:
30-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
30+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
31+
32+
- name: Send custom JSON data to Slack workflow
33+
id: slack
34+
uses: slackapi/[email protected]
35+
with:
36+
# For posting a rich message using Block Kit
37+
payload: |
38+
{
39+
"text": "GitHub Action build result for SmartUI-StoryBook: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
40+
"blocks": [
41+
{
42+
"type": "section",
43+
"text": {
44+
"type": "mrkdwn",
45+
"text": "`SmartUI-StoryBook-NPM-Package` GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
46+
}
47+
}
48+
]
49+
}
50+
env:
51+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
52+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 commit comments

Comments
 (0)