Skip to content

Commit 17d2fdf

Browse files
committed
Fix setting branch protection failure in GHA
This is necessary to resolve the problem of GitHub treating the `skipped` `check` job result as an acceptable outcome and merging broken Dependabot PRs with auto-merge. For example: aio-libs#6330. Inspired by: pyca/cryptography#6512 (comment)
1 parent c2762a7 commit 17d2fdf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,18 @@ jobs:
183183
fail_ci_if_error: false
184184

185185
check: # This job does nothing and is only used for the branch protection
186+
if: always()
187+
186188
needs:
187189
- test
188190

189191
runs-on: ubuntu-latest
190192

191193
steps:
192-
- name: Report success of the test matrix
193-
run: >-
194-
print("All's good")
195-
shell: python
194+
- name: Decide whether the needed jobs succeeded or failed
195+
uses: re-actors/alls-green@release/v1
196+
with:
197+
jobs: ${{ toJSON(needs) }}
196198

197199
pre-deploy:
198200
name: Pre-Deploy

0 commit comments

Comments
 (0)