Skip to content

Commit 001a73e

Browse files
authored
add a validate-success job to the PR workflow (#592)
1 parent 85d9463 commit 001a73e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/pull-request.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,27 @@ jobs:
204204
license: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE }}
205205
testim-access-token: ${{ secrets.TESTIM_ACCESS_TOKEN }}
206206
testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }}
207+
208+
209+
# this job will validate that all the tests passed
210+
# it is used for the github branch protection rule
211+
validate-success:
212+
runs-on: ubuntu-20.04
213+
needs:
214+
- e2e
215+
- sanitize
216+
- tests
217+
if: always()
218+
steps:
219+
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
220+
- name: fail if e2e job was not successful
221+
if: needs.e2e.result != 'success'
222+
run: exit 1
223+
- name: fail if sanitize job was not successful
224+
if: needs.sanitize.result != 'success'
225+
run: exit 1
226+
- name: fail if tests job was not successful
227+
if: needs.tests.result != 'success'
228+
run: exit 1
229+
- name: succeed if everything else passed
230+
run: echo "Validation succeeded"

0 commit comments

Comments
 (0)