From 9c70593472cd041c68b5197d90343b0bbdda8d16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:33:09 +0000 Subject: [PATCH 01/10] chore(gha): bump slackapi/slack-github-action from 1.27.0 to 2.0.0 Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.27.0 to 2.0.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/v1.27.0...v2.0.0) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/slack-send-message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index 230afdd..8c15dfc 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ vars.RUNNER_UBUNTU }} steps: - name: Send message to Slack - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 with: channel-id: ${{ github.event.inputs.channel-or-user }} payload: | From cb2c2be70b1d5e4e70feb77cc49e23592114ee7f Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:07:01 +0100 Subject: [PATCH 02/10] WIP use new syntax for the slack action --- .github/workflows/slack-send-message.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index 8c15dfc..8c925db 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -13,12 +13,18 @@ on: jobs: send: runs-on: ${{ vars.RUNNER_UBUNTU }} + env: + SLACK_CHANNEL: ${{ inputs.channel-or-user }} // sanitize user inputs steps: - name: Send message to Slack uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ github.event.inputs.channel-or-user }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | + channel: ${{ env.SLACK_CHANNEL }} + text: "This is a test from the ${{github.repository}} repository" + blocks: { "blocks": [ { @@ -51,5 +57,3 @@ jobs: } ] } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 7d3aa7fc7eda091e6bb614ff0cf3b18da335faa7 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:12:05 +0100 Subject: [PATCH 03/10] WIP: migrate blocks syntax from JSON to YAML --- .github/workflows/slack-send-message.yml | 69 +++++++++++++----------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index 8c925db..4a7c4e2 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -25,35 +25,40 @@ jobs: channel: ${{ env.SLACK_CHANNEL }} text: "This is a test from the ${{github.repository}} repository" blocks: - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": ":mega: This is a test from the ${{github.repository}} repository", - "emoji": true - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "- available :heavy_check_mark: \n - Check packages published on :heavy_check_mark:" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "See the next steps :arrow_left:" - } - } - ] - } + - type: "section" + text: + type: "mrkdwn" + text: ":mega: This is a test from the ${{github.repository}} repository" + emoji: true +# { +# "blocks": [ +# { +# "type": "header", +# "text": { +# "type": "plain_text", +# "text": ":mega: This is a test from the ${{github.repository}} repository", +# "emoji": true +# } +# }, +# { +# "type": "divider" +# }, +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "- available :heavy_check_mark: \n - Check packages published on :heavy_check_mark:" +# } +# }, +# { +# "type": "divider" +# }, +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "See the next steps :arrow_left:" +# } +# } +# ] +# } From bec7f6b6d7617376a6ce06b7719a5c5d476c882d Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:18:24 +0100 Subject: [PATCH 04/10] WIP: temp disable blocks --- .github/workflows/slack-send-message.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index 4a7c4e2..a4fe190 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -24,12 +24,12 @@ jobs: payload: | channel: ${{ env.SLACK_CHANNEL }} text: "This is a test from the ${{github.repository}} repository" - blocks: - - type: "section" - text: - type: "mrkdwn" - text: ":mega: This is a test from the ${{github.repository}} repository" - emoji: true +# blocks: +# - type: "section" +# text: +# type: "mrkdwn" +# text: ":mega: This is a test from the ${{github.repository}} repository" +# emoji: true # { # "blocks": [ # { From de5be779e062f8af649b061df0d6243fa30381fb Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:21:26 +0100 Subject: [PATCH 05/10] slack: enable errors --- .github/workflows/slack-send-message.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index a4fe190..ee08634 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -19,6 +19,7 @@ jobs: - name: Send message to Slack uses: slackapi/slack-github-action@v2.0.0 with: + errors: true method: chat.postMessage token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | From be76ceb3652c98103241f633242a98e199a10ef7 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:24:03 +0100 Subject: [PATCH 06/10] fix channel value (use correct yaml comment) --- .github/workflows/slack-send-message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index ee08634..5a8fedc 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -14,7 +14,7 @@ jobs: send: runs-on: ${{ vars.RUNNER_UBUNTU }} env: - SLACK_CHANNEL: ${{ inputs.channel-or-user }} // sanitize user inputs + SLACK_CHANNEL: ${{ inputs.channel-or-user }} # sanitize user inputs steps: - name: Send message to Slack uses: slackapi/slack-github-action@v2.0.0 From 312dc5d8c990db81c1e3dd851e3a6f7c4839a796 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:25:34 +0100 Subject: [PATCH 07/10] WIP start restoring "slack blocks" configuration --- .github/workflows/slack-send-message.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index 5a8fedc..f2222f0 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -25,12 +25,12 @@ jobs: payload: | channel: ${{ env.SLACK_CHANNEL }} text: "This is a test from the ${{github.repository}} repository" -# blocks: -# - type: "section" -# text: -# type: "mrkdwn" -# text: ":mega: This is a test from the ${{github.repository}} repository" -# emoji: true + blocks: + - type: "section" + text: + type: "mrkdwn" + text: ":mega: This is a test from the ${{github.repository}} repository" + emoji: true # { # "blocks": [ # { From cf1578e528654dc67ded1927bb9073274c6aeeb2 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:32:55 +0100 Subject: [PATCH 08/10] blocks: remove emoji (docs says, only valid when using plain_text type) --- .github/workflows/slack-send-message.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index f2222f0..ea48931 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -30,7 +30,6 @@ jobs: text: type: "mrkdwn" text: ":mega: This is a test from the ${{github.repository}} repository" - emoji: true # { # "blocks": [ # { From 1314f0c9665f3b52306e8696d68bdf2a054271fa Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:36:22 +0100 Subject: [PATCH 09/10] blocks: migrate json to yaml --- .github/workflows/slack-send-message.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index ea48931..8cb4ad6 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -26,10 +26,22 @@ jobs: channel: ${{ env.SLACK_CHANNEL }} text: "This is a test from the ${{github.repository}} repository" blocks: + - type: "header" + text: + type: "plain_text" + text: ":mega: This is a test from the ${{github.repository}} repository" + emoji: true + - type: "divider" - type: "section" text: type: "mrkdwn" - text: ":mega: This is a test from the ${{github.repository}} repository" + text: "- available :heavy_check_mark: \n - Check packages published on :heavy_check_mark:" + - type: "divider" + - type: "section" + text: + type: "mrkdwn" + text: "See the next steps :arrow_left:" + # { # "blocks": [ # { From d02e8b6e92c0a4ade423894547b86541dbcb3c1c Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:44:08 +0100 Subject: [PATCH 10/10] clean commented configuration --- .github/workflows/slack-send-message.yml | 33 ------------------------ 1 file changed, 33 deletions(-) diff --git a/.github/workflows/slack-send-message.yml b/.github/workflows/slack-send-message.yml index 8cb4ad6..0e12c1b 100644 --- a/.github/workflows/slack-send-message.yml +++ b/.github/workflows/slack-send-message.yml @@ -41,36 +41,3 @@ jobs: text: type: "mrkdwn" text: "See the next steps :arrow_left:" - -# { -# "blocks": [ -# { -# "type": "header", -# "text": { -# "type": "plain_text", -# "text": ":mega: This is a test from the ${{github.repository}} repository", -# "emoji": true -# } -# }, -# { -# "type": "divider" -# }, -# { -# "type": "section", -# "text": { -# "type": "mrkdwn", -# "text": "- available :heavy_check_mark: \n - Check packages published on :heavy_check_mark:" -# } -# }, -# { -# "type": "divider" -# }, -# { -# "type": "section", -# "text": { -# "type": "mrkdwn", -# "text": "See the next steps :arrow_left:" -# } -# } -# ] -# }