-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
79 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,21 +24,6 @@ jobs: | |
# Slack channel id, channel name, or user id to post message. | ||
# See also: https://api.slack.com/methods/chat.postMessage#channels | ||
channel-id: 'C07MUHXPX97' | ||
# For posting a rich message using Block Kit | ||
# payload: | | ||
# { | ||
# "username": "Testing Action", | ||
# "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", | ||
# "blocks": [ | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": "old *bolded* text" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
payload-file-path: "./payload.json" | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
@@ -55,25 +40,19 @@ jobs: | |
fetch-depth: 0 | ||
ref: ${{ github.head_ref || github.ref_name }} | ||
|
||
- name: update payload | ||
run: | | ||
var data = JSON.parse(fs.readFileSync("./payload.json")); | ||
data.blocks[3].elements[1].elements[0].elements[0].name = 'red_circle'; | ||
echo JSON.stringify(data) > ./payload.json | ||
- uses: slackapi/[email protected] | ||
with: | ||
# Unlike the step posting a new message, this step does not accept a channel name. | ||
# Please use a channel ID, not a name here. | ||
channel-id: "C07MUHXPX97" | ||
update-ts: ${{ needs.initial_msg.outputs.slack_msg_ts }} | ||
payload: | | ||
{ | ||
"text": "Blah blah blah", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*bolded* text" | ||
} | ||
} | ||
] | ||
} | ||
payload-file-path: "./payload.json" | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,83 @@ | ||
{ | ||
"username": "Testing Action", | ||
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", | ||
"text": "GitHub Action build Status", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "GitHub Action build Status Header", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "old *bolded* text" | ||
"text": "This is a mrkdwn section block :ghost: *this is bold*, and ~this is crossed out~, and <https://google.com|this is a link>" | ||
} | ||
}, | ||
{ | ||
"type": "rich_text", | ||
"elements": [ | ||
{ | ||
"type": "rich_text_section", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"text": "Basic bullet list with rich elements\n" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "rich_text_list", | ||
"style": "bullet", | ||
"elements": [ | ||
{ | ||
"type": "rich_text_section", | ||
"elements": [ | ||
{ | ||
"type": "emoji", | ||
"name": "white_circle" | ||
}, | ||
{ | ||
"type": "text", | ||
"text": "item 1: " | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "rich_text_section", | ||
"elements": [ | ||
{ | ||
"type": "emoji", | ||
"name": "white_circle" | ||
}, | ||
{ | ||
"type": "text", | ||
"text": "item 2: " | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "rich_text_section", | ||
"elements": [ | ||
{ | ||
"type": "emoji", | ||
"name": "large_green_circle" | ||
}, | ||
{ | ||
"type": "text", | ||
"text": "item 3: " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |