Skip to content

Commit 525d8dc

Browse files
committed
Checkout PR changes for testing instead of main
This solves the issue where the github workflow was using the latest commit from main instead of the new commit from the PR. Issue came about because we need to use pull_request_target to use a secret in the workflow. This change uses github.event.pull_request.head.sha to get the PR changes to test now Assisted-by: Gemini Signed-off-by: Adam Scerra <ascerra@redhat.com>
1 parent 7bc924d commit 525d8dc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/checks-sealights.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ jobs:
5151
echo "Invalid context for this workflow run. Exiting."
5252
exit 1
5353
54-
- name: Checkout repository
54+
- name: Checkout PR Head
5555
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5656
with:
57-
# Needed in hack/derive-version.sh
58-
fetch-depth: 0
57+
ref: ${{ github.event.pull_request.head.sha }}
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
60+
- name: Show git sha and commit subject
61+
run: git log --oneline -n1
62+
5963

6064
- name: Restore Cache
6165
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2

0 commit comments

Comments
 (0)