From c8148229d1d50c7f90d134f491ec3ede303ddbd5 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 28 Oct 2024 15:40:14 -0700 Subject: [PATCH] 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