From 448a02371d18e75677f4a54eb0228fcf9174c35a Mon Sep 17 00:00:00 2001 From: Sophie Date: Tue, 5 Mar 2024 11:00:51 -0700 Subject: [PATCH] Notify on slack when CI fails --- .github/workflows/ci.yml | 11 +++++++++++ .github/workflows/refresh-manifests.yml | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11ac4626..e05c3aed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,17 @@ jobs: with: name: fuellabs authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Notify if Job Fails + uses: ravsamhq/notify-slack-action@v1 + with: + status: ${{ job.status }} + token: ${{ secrets.GITHUB_TOKEN }} + notification_title: "{workflow} has {status_message}" + message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>" + footer: "" + notify_when: "failure" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOOLING }} nix-develop: needs: nix-build diff --git a/.github/workflows/refresh-manifests.yml b/.github/workflows/refresh-manifests.yml index 9cbe847f..27dc6859 100644 --- a/.github/workflows/refresh-manifests.yml +++ b/.github/workflows/refresh-manifests.yml @@ -56,6 +56,17 @@ jobs: name: fuellabs authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix build --print-build-logs --no-update-lock-file .#${{ matrix.package }} + - name: Notify if Job Fails + uses: ravsamhq/notify-slack-action@v1 + with: + status: ${{ job.status }} + token: ${{ secrets.GITHUB_TOKEN }} + notification_title: "{workflow} has {status_message}" + message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>" + footer: "" + notify_when: "failure" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOOLING }} download-manifests-and-commit: needs: [refresh-and-upload-manifests, download-manifests-and-nix-build] @@ -81,3 +92,14 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: master + - name: Notify if Job Fails + uses: ravsamhq/notify-slack-action@v1 + with: + status: ${{ job.status }} + token: ${{ secrets.GITHUB_TOKEN }} + notification_title: "{workflow} has {status_message}" + message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>" + footer: "" + notify_when: "failure" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOOLING }}