From ffee50b57cb47e4da60507b2490f436266f31bd6 Mon Sep 17 00:00:00 2001 From: Levente Balogh Date: Tue, 8 Feb 2022 11:20:11 +0100 Subject: [PATCH] chore: send a notification to Slack when there is a breaking change (#44699) We would like this to have a bit better chance for helping out with breaking changes in the beginning and also to have a historical overview of what happened. --- .../workflows/detect-breaking-changes-report.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/detect-breaking-changes-report.yml b/.github/workflows/detect-breaking-changes-report.yml index 94a64eb5aeb..ce6a6d15fd2 100644 --- a/.github/workflows/detect-breaking-changes-report.yml +++ b/.github/workflows/detect-breaking-changes-report.yml @@ -99,6 +99,21 @@ jobs: number: ${{ github.event.workflow_run.pull_requests[0].number }} delete: true + # Posts a notification to Slack if a PR has a breaking change and it did not have a breaking change before + - name: Post to Slack + id: slack + if: ${{ steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 }} + uses: slackapi/slack-github-action@v1.18.0 + with: + payload: | + { + "pr_link": "${{ github.event.workflow_run.pull_requests[0].url }}", + "pr_number": "${{ github.event.workflow_run.pull_requests[0].number }}", + "job_link": "${{ steps.levitate-run.outputs.job_link }}", + "message": "${{ steps.levitate-run.outputs.message }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_LEVITATE_WEBHOOK_URL }} - name: Add "breaking change" label if: ${{ steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 }}