Skip to content

Commit 148f669

Browse files
authored
chore: "passed" fails if any previous jobs fail or are cancelled (#5776)
For the purposes of being able to merge a PR, Github Actions jobs count as passed if they ran and passed, or were skipped. With this change, if any of the jobs that "passed" depends on fail or are cancelled, then "passed" will fail. If they all succeed or are skipped, then "passed" is skipped, which does not prevent a merge. This saves spinning up a runner in the usual case where things work, and will simplify our branch protection rules, so that only "passed" will need to be checked.
1 parent f1eaa6a commit 148f669

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/on-pr.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ jobs:
125125
conan_remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }}
126126

127127
passed:
128+
if: failure() || cancelled()
128129
needs:
129130
- build-test
130131
- check-format
131132
- check-levelization
132133
runs-on: ubuntu-latest
133134
steps:
134-
- name: No-op
135-
run: true
135+
- name: Fail
136+
run: false

0 commit comments

Comments
 (0)