From c6ea6a3c463322891aae14030bf024c0b35fe030 Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Mon, 2 Dec 2024 13:32:29 +0000 Subject: [PATCH] feat: add slack notifications on failed workflows --- .github/workflows/release-plz.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release-plz.yaml b/.github/workflows/release-plz.yaml index 0f58b5f..29e5fae 100644 --- a/.github/workflows/release-plz.yaml +++ b/.github/workflows/release-plz.yaml @@ -9,6 +9,9 @@ on: cargo_registry_token: description: 'Cargo registry token' required: true + slack_webhook: + description: 'Slack webhook for notifications' + required: true inputs: run_tests: type: boolean @@ -60,6 +63,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.gh_token }} CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }} + - name: Notify about failure + if: failure() + uses: matter-labs/format-release-please-for-slack-action@69e6fe9e4ec531b7b5fb0d826f73c190db83cf42 # v2.1.0 + with: + release-please-output: '{ "body": "⚠️ Failed to publish the release" }' + slack-webhook-url: ${{ secrets.slack_webhook }} + # Create a PR with the new versions and changelog, preparing the next release. release-plz-pr: name: Release-plz PR