From c8148229d1d50c7f90d134f491ec3ede303ddbd5 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 15:40:14 -0700 Subject: [PATCH 01/12] add release-notify-slack workflow --- .github/workflows/release-notify-slack.yml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release-notify-slack.yml diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml new file mode 100644 index 000000000..525f8a53c --- /dev/null +++ b/.github/workflows/release-notify-slack.yml @@ -0,0 +1,39 @@ +name: Notify Dev DX Channel on Release + +on: + release: + types: [published] +# if: github-token.repository == 'linode/linode_api4-python' + steps: + - name: Notify Slack - Main Message + id: main_message + uses: slackapi/slack-github-action@v1.27.0 + with: + 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:" + } + } + ] + } + 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.SLACK_CHANNEL_ID }} + payload: | + { + "thread_ts": "${{ steps.main_message.outputs.ts }}", + "text": "Release Notes:\n${{ github.event.release.body }}" + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file From 7b5a952d3a9668737a4c64dc3176b660af561d32 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 15:58:24 -0700 Subject: [PATCH 02/12] add release-notify-slack workflow --- .github/workflows/release-notify-slack.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 525f8a53c..43ad756d8 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -3,7 +3,10 @@ name: Notify Dev DX Channel on Release on: release: 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 @@ -23,7 +26,7 @@ on: } ] } - env: + env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - name: Notify Slack - Threaded Release Notes @@ -36,4 +39,4 @@ on: "text": "Release Notes:\n${{ github.event.release.body }}" } env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From eeacafade016d5f58b9d6d3264d1bd20aae25565 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 16:01:28 -0700 Subject: [PATCH 03/12] add workflow dispatch --- .github/workflows/release-notify-slack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 43ad756d8..d67b9dd27 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -1,7 +1,7 @@ name: Notify Dev DX Channel on Release - on: release: + workflow_dispatch: null types: [published] jobs: From 05797abf7fe69955a17aea375f7c9c61c870af2b Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 16:37:50 -0700 Subject: [PATCH 04/12] gha test 1 --- .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 d67b9dd27..53fff75ac 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -21,7 +21,7 @@ jobs: "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: *<${{ github.event.release.html_url }}|${{ github.repository }} - ${{ github.event.release.tag_name }}>* is now live! :tada:" } } ] @@ -36,7 +36,7 @@ jobs: payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "Release Notes:\n${{ github.event.release.body }}" + "text": "Release Notes" } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From fe95fdcab380372f49c765aa53a4d61186f33bf1 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 16:41:57 -0700 Subject: [PATCH 05/12] gha test 2 --- .github/workflows/release-notify-slack.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 53fff75ac..c6b6a8fdb 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -15,13 +15,12 @@ jobs: channel-id: ${{ secrets.SLACK_CHANNEL_ID }} payload: | { - "text": "*New Release Published in ${{ github.repository }}!*", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", - "text": "*New Release Published: *<${{ github.event.release.html_url }}|${{ github.repository }} - ${{ github.event.release.tag_name }}>* is now live! :tada:" + "text": "New Release Published: *<${{ github.event.release.html_url }}|${{ github.repository }} - ${{ github.event.release.tag_name }}>* is now live! :tada:" } } ] @@ -36,7 +35,7 @@ jobs: payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "Release Notes" + "text": "${{ github.event.release.body }}" } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 94c48f0457aead448e6a9601fb283054cf00449b Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 16:47:21 -0700 Subject: [PATCH 06/12] gha test 3 --- .github/workflows/release-notify-slack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index c6b6a8fdb..493f396e8 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -35,7 +35,7 @@ jobs: payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "${{ github.event.release.body }}" + "text": "Release Notes:\n${{ toJSON(github.event.release.body) }}" } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From b8a56e8090d569d24cb62274b30376a27e4fd803 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 17:12:17 -0700 Subject: [PATCH 07/12] gha test 4 --- .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 493f396e8..1fc5782cd 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -20,7 +20,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "New Release Published: *<${{ 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:" } } ] @@ -35,7 +35,7 @@ jobs: payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "Release Notes:\n${{ toJSON(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 }} From 9314f0be69465a78bebf91a9cf742de2ced3c9ff Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 17:17:53 -0700 Subject: [PATCH 08/12] gha test 5 --- .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 1fc5782cd..6ba254253 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -20,7 +20,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.tag_name }} is now live!* :tada:" } } ] @@ -35,7 +35,7 @@ jobs: payload: | { "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "*<${{ github.event.release.html_url }}| ${{ github.event.release.tag_name }} Release notes }}>* + "text": "*<${{ github.event.release.html_url }}| ${{ github.event.release.tag_name }} Release notes }}>*" } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 3f8f9fa7190ce3b8fe719b98515755ea1f2f1aea Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 17:21:51 -0700 Subject: [PATCH 09/12] 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 525f8a53c..dd518b9d7 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 10/12] 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 dd518b9d7..389922e6d 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 11/12] 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 389922e6d..de7689a30 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 }} From e67055b66a7a369521ae2cde060f79f469e5a43f Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Tue, 29 Oct 2024 12:33:26 -0700 Subject: [PATCH 12/12] update slack payload to include link to release notes --- .github/workflows/release-notify-slack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index de7689a30..131f042df 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -6,7 +6,7 @@ on: jobs: notify: -# if: github.repository == 'linode/linode_api4-python' + if: github.repository == 'linode/linode_api4-python' runs-on: ubuntu-latest steps: - name: Notify Slack - Main Message