Skip to content

Commit

Permalink
Try using a payload file
Browse files Browse the repository at this point in the history
  • Loading branch information
pingevt committed Sep 15, 2024
1 parent 67859bb commit 4ad52e5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/testing-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ jobs:
# 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: |
# {
# "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 }}

Expand Down
13 changes: 13 additions & 0 deletions payload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"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"
}
}
]
}

0 comments on commit 4ad52e5

Please sign in to comment.