From 3f8f9fa7190ce3b8fe719b98515755ea1f2f1aea Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 17:21:51 -0700 Subject: [PATCH 1/3] fix payload syntax --- .github/workflows/release-notify-slack.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 525f8a53..dd518b9d 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -1,9 +1,12 @@ name: Notify Dev DX Channel on Release - on: release: + workflow_dispatch: null types: [published] -# if: github-token.repository == 'linode/linode_api4-python' + +jobs: + notify: + runs-on: ubuntu-latest steps: - name: Notify Slack - Main Message id: main_message @@ -12,18 +15,17 @@ on: channel-id: ${{ secrets.SLACK_CHANNEL_ID }} payload: | { - "text": "*New Release Published in ${{ github.repository }}!*", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", - "text": "*<${{ github.event.release.html_url }}|${{ github.repository }}: ${{ github.event.release.tag_name }}>* is now live! :tada:" + "text": "*New Release Published: _linode_api4-python_ - ${{ github.event.release.tag_name }} is now live!* :tada:" } } ] } - env: + env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - name: Notify Slack - Threaded Release Notes @@ -33,7 +35,7 @@ on: payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "Release Notes:\n${{ github.event.release.body }}" + "text": "*<${{ github.event.release.html_url }}| ${{ github.event.release.tag_name }} Release notes>*" } env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 616ad90b74907ed0001ecd04761dcb6e654a8b5a Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 17:25:03 -0700 Subject: [PATCH 2/3] change environment variable name --- .github/workflows/release-notify-slack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index dd518b9d..389922e6 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -12,7 +12,7 @@ jobs: id: main_message uses: slackapi/slack-github-action@v1.27.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} payload: | { "blocks": [ @@ -31,7 +31,7 @@ jobs: - name: Notify Slack - Threaded Release Notes uses: slackapi/slack-github-action@v1.27.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", From 7625b8919789aceb599cd6103669951838244877 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Tue, 29 Oct 2024 12:27:05 -0700 Subject: [PATCH 3/3] update slack payload for gh test --- .github/workflows/release-notify-slack.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 389922e6..de7689a3 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -1,11 +1,12 @@ name: Notify Dev DX Channel on Release on: release: - workflow_dispatch: null types: [published] + workflow_dispatch: null jobs: notify: +# if: github.repository == 'linode/linode_api4-python' runs-on: ubuntu-latest steps: - name: Notify Slack - Main Message @@ -20,7 +21,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*New Release Published: _linode_api4-python_ - ${{ github.event.release.tag_name }} is now live!* :tada:" + "text": "*New Release Published: _linode_api4-python_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:" } } ] @@ -28,14 +29,3 @@ jobs: env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - - name: Notify Slack - Threaded Release Notes - uses: slackapi/slack-github-action@v1.27.0 - with: - channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} - payload: | - { - "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "*<${{ github.event.release.html_url }}| ${{ github.event.release.tag_name }} Release notes>*" - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}