File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 3535 repository : ${{ matrix.repo.name }}
3636 path : ${{ env.test_repo_path }}
3737
38+ - name : Check for branch ${{ github.head_ref }}
39+ id : check-head-ref
40+ working-directory : ${{ env.test_repo_path }}
41+ if : github.event_name == 'pull_request'
42+ run : |
43+ git remote update
44+ git checkout ${{ github.head_ref }}
45+ if [ $? -eq 0 ]; then
46+ echo "Using branch ${{github.head_ref}}"
47+ echo "found-branch=1\n" >> $GITHUB_OUTPUT
48+ else
49+ echo "${{github.head_ref}} not found, checking base ${{github.base_ref}}"
50+ echo "found-branch=0\n" >> $GITHUB_OUTPUT
51+ fi
52+
53+ - name : Check for branch ${{ github.base_ref }}
54+ id : check-base-ref
55+ working-directory : ${{ env.test_repo_path }}x
56+ if : github.event_name == 'pull_request' && steps.check-head-ref == 0
57+ run : |
58+ git remote update
59+ git checkout ${{ github.base_ref }}
60+ if [ $? -eq 0 ]; then
61+ echo "Using branch ${{github.base_ref}}"
62+ echo "found-branch=1\n" >> $GITHUB_OUTPUT
63+ else
64+ || echo "${{github.base_ref}} not found Falling back to main"
65+ echo "found-branch=0\n" >> $GITHUB_OUTPUT
66+ fi
67+
3868 - name : Check for branch ${{ github.head_ref }}
3969 working-directory : ${{ env.test_repo_path }}
4070 if : github.event_name == 'pull_request'
You can’t perform that action at this time.
0 commit comments