Skip to content

Commit 1a6b828

Browse files
authored
Inject check job into CI workflow as ultimate flag (#55)
This patch adds a job that is able to accurately signal whether all the expectations of the required jobs to succeed are met. This job can then be used as a source of truth for judging whether "CI passes" and can be used in the branch protection. It also plays a role of a convenient "gate" — this is the only job that would have to be listed in the branch protection as opposed to listing every single job name generated by the test matrix (and they all have different names — it's not possible to just select one `test` job name). Ref: https://github.com/re-actors/alls-green#why
1 parent 04fe68a commit 1a6b828

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/main.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,23 @@ jobs:
2727
- name: Run tests
2828
run: tox
2929

30+
check: # This job does nothing and is only used for the branch protection
31+
if: always()
32+
33+
needs:
34+
- test
35+
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Decide whether the needed jobs succeeded or failed
40+
uses: re-actors/alls-green@release/v1
41+
with:
42+
jobs: ${{ toJSON(needs) }}
43+
3044
release:
31-
needs: test
45+
needs:
46+
- check
3247
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
3348
runs-on: ubuntu-latest
3449

0 commit comments

Comments
 (0)