Skip to content

Commit e3809e8

Browse files
authored
Update release_notice.yml
1 parent 2ba47f5 commit e3809e8

File tree

1 file changed

+14
-45
lines changed

1 file changed

+14
-45
lines changed

.github/workflows/release_notice.yml

+14-45
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ReleaseNotice
1+
name: Release Notice
22
on:
33
release:
44
types: [published]
@@ -12,48 +12,17 @@ jobs:
1212
env:
1313
GITHUB_CONTEXT: ${{ toJSON(github) }}
1414
run: echo "$GITHUB_CONTEXT"
15-
- name: Slack Notification on SUCCESS
16-
if: success()
17-
uses: tokorom/action-slack-incoming-webhook@main
18-
env:
19-
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
15+
- name: Send custom JSON data to Slack workflow
16+
id: slack
17+
uses: slackapi/[email protected]
2018
with:
21-
text: A release is published.
22-
blocks: |
23-
[
24-
{
25-
"type": "header",
26-
"text": {
27-
"type": "plain_text",
28-
"text": "${{ github.event.release.tag_name}} is published!"
29-
}
30-
},
31-
{
32-
"type": "section",
33-
"text": {
34-
"type": "mrkdwn",
35-
"text": "*Author:*\n${{ github.actor }}"
36-
}
37-
},
38-
{
39-
"type": "section",
40-
"text": {
41-
"type": "mrkdwn",
42-
"text": "*Information:*"
43-
}
44-
},
45-
{
46-
"type": "section",
47-
"text": {
48-
"type": "mrkdwn",
49-
"text": ${{ toJSON(github.event.release.body) }}
50-
}
51-
},
52-
{
53-
"type": "section",
54-
"text": {
55-
"type": "mrkdwn",
56-
"text": "${{ github.event.release.html_url }}"
57-
}
58-
}
59-
]
19+
# This data can be any valid JSON from a previous step in the GitHub Action
20+
payload: |
21+
{
22+
"tag_name": "${{ github.event.release.tag_name}}",
23+
"actor": "${{ github.actor }}",
24+
"body": "${{ toJSON(github.event.release.body) }}",
25+
"html_url": "${{ github.event.release.html_url }}"
26+
}
27+
env:
28+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASE }}

0 commit comments

Comments
 (0)