Skip to content

Commit

Permalink
Prevent a PR with failed actions from being merged (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Feb 2, 2024
1 parent 53648ca commit 3ff4abc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ jobs:

# Specifying a dependent job allows us to select a single "requires" check in the project GitHub settings
all:
# Complete if jobs were skipped (but not if any failed or were cancelled)
if: ${{ always() && !failure() && !cancelled() }}
needs: [build]
if: ${{ always() }}
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Success
run: |
echo 'Checks passed {"head_ref": "${{github.head_ref}}"}'
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

# vim: set nowrap tw=100:

0 comments on commit 3ff4abc

Please sign in to comment.