From 76a96b07457b70a7f70ec3bca534a94f7d4474ff Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Wed, 6 Sep 2023 17:52:21 +0100 Subject: [PATCH] Notify Slack channel about upcoming releases (#5197) ## Problem When the next release is coming, we want to let everyone know about it by posting a message to the Slack channel with a list of commits. ## Summary of changes - `.github/workflows/release-notify.yml` is added - the workflow sends a message to `vars.SLACK_UPCOMING_RELEASE_CHANNEL_ID` (or [#test-release-notifications](https://neondb.slack.com/archives/C05QQ9J1BRC) if not configured) - On each PR update, the workflow updates the list of commits in the message (it doesn't send additional messages) --- .github/workflows/release-notify.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/release-notify.yml diff --git a/.github/workflows/release-notify.yml b/.github/workflows/release-notify.yml new file mode 100644 index 0000000000..ba396dba74 --- /dev/null +++ b/.github/workflows/release-notify.yml @@ -0,0 +1,29 @@ +name: Notify Slack channel about upcoming release + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }} + cancel-in-progress: true + +on: + pull_request: + branches: + - release + types: + # Default types that triggers a workflow: + # - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request + - opened + - synchronize + - reopened + # Additional types that we want to handle: + - closed + +jobs: + notify: + runs-on: [ ubuntu-latest ] + + steps: + - uses: neondatabase/dev-actions/release-pr-notify@main + with: + slack-token: ${{ secrets.SLACK_BOT_TOKEN }} + slack-channel-id: ${{ vars.SLACK_UPCOMING_RELEASE_CHANNEL_ID || 'C05QQ9J1BRC' }} # if not set, then `#test-release-notifications` + github-token: ${{ secrets.GITHUB_TOKEN }}