Skip to content

Checkout correct branch on pull_request_target trigger #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ name: "Run smoke tests via Tox::pytest (python 3.11)"
# These tests will be long running and require accelerated hardware.

on:
workflow_dispatch:
inputs:
branch:
type: string
default: main
workflow_dispatch: {}
# using this rather than pull_request because this workflow
# needs to run in the context of the base branch (main) and
# access the repo's secrets to start the AWS instances.
Expand Down Expand Up @@ -115,7 +111,13 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: ${{inputs.branch}}

- name: "Fetch and checkout PR"
# Needed because this workflow runs on pull_request_target which runs on the base branch (e.g. main)
if: ${{ github.event_name == 'pull_request_target'}}
run: |
git fetch origin pull/${{ github.event.number }}/head:pr-${{ github.event.number }}
git checkout pr-${{ github.event.number }}

- name: Run smoke tests
uses: ./.github/actions/run-smoke
Expand Down