Skip to content

Commit a45229b

Browse files
critesjoshclaude
andcommitted
Pin checkout ref to default branch
Prevents a PR from targeting a base branch that carries a historically vulnerable version of the script. Per ludamad's review on #18. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dc6aeb1 commit a45229b

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/link-azip-to-discussion.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ jobs:
5050
- name: Checkout workflow scripts only
5151
uses: actions/checkout@v4
5252
with:
53-
# Intentionally check out the base ref, NOT the PR head. We only
54-
# need the script in `.github/scripts/`. PR contents are fetched
55-
# separately via the API and parsed without execution.
56-
# Uses the PR's base ref when triggered by pull_request_target, so
57-
# the script matches the branch the PR will merge into; falls back
58-
# to the default branch for manual workflow_dispatch runs.
59-
ref: ${{ github.event.pull_request.base.ref || github.event.repository.default_branch }}
53+
# Always check out the default branch, NOT the PR head or its base
54+
# ref. We only need the script in `.github/scripts/`; PR contents
55+
# are fetched separately via the API and parsed without execution.
56+
# Pinning to the default branch prevents a PR from targeting a base
57+
# branch that carries a historically vulnerable script version.
58+
ref: ${{ github.event.repository.default_branch }}
6059
sparse-checkout: |
6160
.github/scripts
6261
sparse-checkout-cone-mode: false

0 commit comments

Comments
 (0)