From 4ad52e56b111dc89e532b84640496fe52e5da983 Mon Sep 17 00:00:00 2001 From: Pete Inge Date: Sat, 14 Sep 2024 20:27:00 -0400 Subject: [PATCH] Try using a payload file --- .github/workflows/testing-slack.yml | 29 +++++++++++++++-------------- payload.json | 13 +++++++++++++ 2 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 payload.json diff --git a/.github/workflows/testing-slack.yml b/.github/workflows/testing-slack.yml index f336492a..eb146c25 100644 --- a/.github/workflows/testing-slack.yml +++ b/.github/workflows/testing-slack.yml @@ -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 }} diff --git a/payload.json b/payload.json new file mode 100644 index 00000000..5643f8b4 --- /dev/null +++ b/payload.json @@ -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" + } + } + ] +}