Skip to content

Commit c9e07e9

Browse files
authored
Merge pull request #549 from fynnsu/fix_smoke
Checkout correct branch on `pull_request_target` trigger
2 parents 547a820 + 3aaaae6 commit c9e07e9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/smoke.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ name: "Run smoke tests via Tox::pytest (python 3.11)"
44
# These tests will be long running and require accelerated hardware.
55

66
on:
7-
workflow_dispatch:
8-
inputs:
9-
branch:
10-
type: string
11-
default: main
7+
workflow_dispatch: {}
128
# using this rather than pull_request because this workflow
139
# needs to run in the context of the base branch (main) and
1410
# access the repo's secrets to start the AWS instances.
@@ -115,7 +111,13 @@ jobs:
115111
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
116112
with:
117113
fetch-depth: 0
118-
ref: ${{inputs.branch}}
114+
115+
- name: "Fetch and checkout PR"
116+
# Needed because this workflow runs on pull_request_target which runs on the base branch (e.g. main)
117+
if: ${{ github.event_name == 'pull_request_target'}}
118+
run: |
119+
git fetch origin pull/${{ github.event.number }}/head:pr-${{ github.event.number }}
120+
git checkout pr-${{ github.event.number }}
119121
120122
- name: Run smoke tests
121123
uses: ./.github/actions/run-smoke

0 commit comments

Comments
 (0)