Skip to content

Commit

Permalink
Add the checkout ref for incorporating PR (#455)
Browse files Browse the repository at this point in the history
Since we moved to using pull_request_target which executes the
workflow in the context of the base repository but the default HEAD
that gets checked out is now the main branch rather than the PR.
This ensures the pull request HEAD is checked out before running the
workflow.
  • Loading branch information
thunderboltsid authored Jul 9, 2024
1 parent 7dd3dd4 commit 098d8d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"

- uses: actions/cache@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"

# Install nix using cachix/install-nix-action if running on ARC runners
# See: https://github.com/DeterminateSystems/nix-installer-action/issues/68
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/synopsys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"

- name: Install devbox
run: curl -fsSL https://get.jetpack.io/devbox | bash -s -- -f
Expand Down

0 comments on commit 098d8d6

Please sign in to comment.