Skip to content

Commit 2d2ea79

Browse files
authored
Add a specific CI job on which we can gate PRs. This is needed because gating on specific skippable jobs does not work when those jobs are skipped (for example during docs-only PRs) (#335)
Signed-off-by: Ludvig Liljenberg <lliljenberg@microsoft.com>
1 parent fdd5231 commit 2d2ea79

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/ValidatePullRequest.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,24 @@ jobs:
6666
- uses: actions/checkout@v4
6767
- name: Spell Check Repo
6868
uses: crate-ci/typos@v1.29.10
69+
70+
# Gate PR merges on this specific "join-job" which requires all other
71+
# jobs to run first. We need this job since we cannot gate on particular jobs
72+
# in the workflow, since they can sometimes be skipped (e.g. if the PR only touches docs).
73+
# This step fixes this issue by always running.
74+
report-ci-status:
75+
needs:
76+
- docs-pr
77+
- rust
78+
- fuzzing
79+
- spelling
80+
if: always()
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Previous jobs succeeded
84+
if: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
85+
run: exit 0
86+
- name: Previous jobs failed
87+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
88+
run: exit 1
89+

0 commit comments

Comments
 (0)