Skip to content

Commit

Permalink
ci: fix success job (#32)
Browse files Browse the repository at this point in the history
GitHub considers skipped jobs as fulfilling requirements when merging
pull requests. We need to ensure that the success job fails if any
previous job has failed.
  • Loading branch information
CBenoit authored Jul 17, 2024
1 parent 3964867 commit 681c29a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,17 @@ jobs:
success:
name: Success
runs-on: ubuntu-latest
if: ${{ success() }}
if: ${{ always() }}
needs:
- formatting
- checks

steps:
- name: CI succeeded
id: succeeded
if: ${{ !contains(needs.*.result, 'failure') }}
run: exit 0

- name: CI failed
if: ${{ steps.succeeded.outcome == 'skipped' }}
run: exit 1

0 comments on commit 681c29a

Please sign in to comment.