Skip to content

Commit 99026b8

Browse files
committed
Make test-examples workflow check the base ref as well for a PR
1 parent 938a7b9 commit 99026b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/test-examples.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ jobs:
4040
if: github.event_name == 'pull_request'
4141
run: |
4242
git remote update
43-
git checkout ${{ github.head_ref }} || echo "Falling back to main"
43+
git checkout ${{ github.head_ref }} || echo "${{github.head_ref}} not found, checking base ${{github.base_ref}}"
44+
45+
- name: Check for branch ${{ github.base_ref }}
46+
working-directory: ${{ env.test_repo_path }}
47+
if: github.event_name == 'pull_request'
48+
run: |
49+
git remote update
50+
git checkout ${{ github.base_ref }} || echo "${{github.base_ref}} not found Falling back to main"
51+
4452
4553
- name: Set up PDM
4654
uses: pdm-project/setup-pdm@v4

0 commit comments

Comments
 (0)