File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,18 +343,23 @@ jobs:
343343 outputs :
344344 test_branch : ${{ steps.check-branch.outputs.test_branch }}
345345 steps :
346- - name : Check if branch exists
346+ - name : Check if head branch or base branch exists
347347 id : check-branch
348348 run : |
349349 if git ls-remote --exit-code \
350350 --heads https://github.com/NHSDigital/manage-vaccinations-in-schools-testing.git \
351- "$BRANCH_TO_CHECK" > /dev/null 2>&1; then
352- echo "test_branch=$BRANCH_TO_CHECK" >> "$GITHUB_OUTPUT"
351+ "$HEAD_REF" > /dev/null 2>&1; then
352+ echo "test_branch=$HEAD_REF" >> "$GITHUB_OUTPUT"
353+ elif git ls-remote --exit-code \
354+ --heads https://github.com/NHSDigital/manage-vaccinations-in-schools-testing.git \
355+ "$BASE_REF" > /dev/null 2>&1; then
356+ echo "test_branch=$BASE_REF" >> "$GITHUB_OUTPUT"
353357 else
354358 echo "test_branch=main" >> "$GITHUB_OUTPUT"
355359 fi
356360 env :
357- BRANCH_TO_CHECK : ${{ github.head_ref }}
361+ HEAD_REF : ${{ github.head_ref }}
362+ BASE_REF : ${{ github.base_ref }}
358363 call-end-to-end-tests :
359364 needs : [launch-dockerized-devimage, wait-for-task-stability, find-correct-test-branch]
360365 if :
You can’t perform that action at this time.
0 commit comments