Skip to content

Commit 4a8fd85

Browse files
committed
chore(ci): add slack release hook
Signed-off-by: Cory Rylan <crylan@nvidia.com>
1 parent e2e225c commit 4a8fd85

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

‎.github/workflows/slack.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release Slack Notification
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
notify:
12+
name: Notify Slack (${{ matrix.destination }})
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
destination: [primary, ci]
17+
runs-on: ubuntu-latest
18+
env:
19+
SLACK_PAYLOAD: |
20+
text: "New Release ${{ github.event.release.tag_name }}"
21+
blocks:
22+
- type: section
23+
text:
24+
type: mrkdwn
25+
text: |
26+
*New Release* :rocket:
27+
28+
<${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}>
29+
<https://nvidia.github.io/elements/docs/changelog/|Changelog>
30+
<https://nvidia.github.io/elements/|Documentation>
31+
steps:
32+
- name: Notify primary Slack channel
33+
if: matrix.destination == 'primary'
34+
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c
35+
with:
36+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
37+
webhook-type: incoming-webhook
38+
payload: ${{ env.SLACK_PAYLOAD }}
39+
- name: Notify CI Slack channel
40+
if: matrix.destination == 'ci'
41+
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c
42+
with:
43+
webhook: ${{ secrets.SLACK_WEBHOOK_URL_CI }}
44+
webhook-type: incoming-webhook
45+
payload: ${{ env.SLACK_PAYLOAD }}

0 commit comments

Comments
 (0)