Skip to content

Commit

Permalink
Add failure check
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrassia committed Oct 7, 2024
1 parent d2cad69 commit db11e5d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/repository-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,50 @@ jobs:
needs: cherry_pick
uses: ./.github/workflows/_move_finalization_db_scripts.yml
secrets: inherit


check-failures:
name: Check for failures
if: always()
runs-on: ubuntu-22.04
needs:
- cut_branch
- bump_version
- cherry_pick
- move_future_db_scripts
steps:
- name: Check if any job failed
if: |
(github.ref == 'refs/heads/main'
|| github.ref == 'refs/heads/rc'
|| github.ref == 'refs/heads/hotfix-rc')
&& contains(needs.*.result, 'failure')
run: exit 1

- name: Clean up new branch
if: failure()
env:
CUT_BRANCH: ${{ inputs.branch_to_cut }}
run: git push -d origin $CUT_BRANCH

- name: Log in to Azure - CI subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
if: failure()
with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}

- name: Retrieve secrets
id: retrieve-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main
if: failure()
with:
keyvault: "bitwarden-ci"
secrets: "devops-alerts-slack-webhook-url"

- name: Notify Slack on failure
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
with:
status: ${{ job.status }}

0 comments on commit db11e5d

Please sign in to comment.