File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments