Skip to content

Commit 1761740

Browse files
committed
fix: checkout step
1 parent 94b5973 commit 1761740

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ jobs:
2121
matrix:
2222
tf: [tofu, terraform]
2323
steps:
24+
# Only checkout for pull_request_target events (not for push to main)
25+
# pull_request_target runs in the context of the base branch for security,
26+
# so we must explicitly checkout the PR's head commit to test the actual changes
2427
- name: Checkout PR Head
25-
if: github.event_name == 'pull_request_target'
28+
if: github.event_name != 'push'
2629
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2730
with:
2831
ref: ${{ github.event.pull_request.head.sha }}

0 commit comments

Comments
 (0)