Skip to content

Commit eaa293c

Browse files
chore: add test slack workflow
1 parent 0041538 commit eaa293c

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/test-slack.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test Slack Notification
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Post to a Slack channel
12+
id: slack
13+
uses: slackapi/slack-github-action@v3.0.1
14+
with:
15+
webhook: ${{ secrets.PIPELINE_SLACK_CHANNEL_WEBHOOK_URL }}
16+
webhook-type: incoming-webhook
17+
# Slack channel id, channel name, or user id to post message.
18+
# See also: https://api.slack.com/methods/chat.postMessage#channels
19+
# channel-id: 'pipeline'
20+
# For posting a rich message using Block Kit
21+
payload: |
22+
{
23+
"text": "Testing Slack Notification ${{github.ref_name}} for ${{github.event.repository.name}}.",
24+
"blocks": [
25+
{
26+
"type": "section",
27+
"text": {
28+
"type": "mrkdwn",
29+
"text": "Testing Slack Notification for <${{github.event.repository.html_url}}|`${{github.event.repository.name}}`>\n*<${{github.event.release.html_url}}|release notes>*"
30+
}
31+
},
32+
{
33+
"type": "section",
34+
"fields": [
35+
{
36+
"type": "mrkdwn",
37+
"text": "*Project:*\n${{github.event.repository.name}}"
38+
},
39+
{
40+
"type": "mrkdwn",
41+
"text": "*Version:*\n${{github.ref_name}}"
42+
}
43+
]
44+
},
45+
{
46+
"type": "context",
47+
"elements": [
48+
{
49+
"type": "image",
50+
"image_url": "${{github.event.sender.avatar_url}}",
51+
"alt_text": "${{github.event.sender.login}}"
52+
},
53+
{
54+
"type": "mrkdwn",
55+
"text": "*${{github.event.sender.login}}* has triggered this release."
56+
}
57+
]
58+
}
59+
]
60+
}

0 commit comments

Comments
 (0)