Skip to content

Commit eacd4c6

Browse files
committed
fix(no-ref): slack workflow
1 parent 62954a9 commit eacd4c6

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.github/workflows/gh-pages.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ jobs:
5555
steps:
5656
- name: Post to a Slack channel
5757
id: slack
58-
uses: slackapi/slack-github-action@v1.25.0
58+
uses: slackapi/slack-github-action@v1.26.0
5959
with:
6060
channel-id: 'deployments'
6161
payload: |
6262
{
63+
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
6364
"blocks": [
6465
{
6566
"type": "section",
@@ -69,7 +70,7 @@ jobs:
6970
}
7071
},
7172
{
72-
"type": "section",
73+
"type": "section"
7374
"text": {
7475
"type": "mrkdwn",
7576
"text": "Project: `${{ github.event.repository.name }}`"

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,50 @@ jobs:
2323
run: npm run publish:lib
2424
env:
2525
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
26+
27+
slack_notification:
28+
needs:
29+
- build
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Post to a Slack channel
33+
id: slack
34+
uses: slackapi/[email protected]
35+
with:
36+
channel-id: 'deployments'
37+
payload: |
38+
{
39+
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
40+
"blocks": [
41+
{
42+
"type": "section",
43+
"text": {
44+
"type": "mrkdwn",
45+
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
46+
}
47+
},
48+
{
49+
"type": "section"
50+
"text": {
51+
"type": "mrkdwn",
52+
"text": "Project: `${{ github.event.repository.name }}`"
53+
}
54+
},
55+
{
56+
"type": "section",
57+
"text": {
58+
"type": "mrkdwn",
59+
"text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
60+
}
61+
},
62+
{
63+
"type": "section",
64+
"text": {
65+
"type": "mrkdwn",
66+
"text": "Website URL: ${{ secrets.WEBSITE_URL || 'TBA' }}"
67+
}
68+
}
69+
]
70+
}
71+
env:
72+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)