Skip to content

Commit 8f13248

Browse files
authored
Fix: CI job refuse pull_request_target (#289)
1 parent 3962d68 commit 8f13248

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: "Release Automation"
32

43
on:
@@ -25,6 +24,11 @@ jobs:
2524
steps:
2625
- name: Checkout Code
2726
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
27+
with:
28+
# PR is guaranteed merged (see job `if`), so this commit is on master.
29+
# Checking out the merge commit avoids fetching fork PR code, which
30+
# actions/checkout v7 refuses in pull_request_target workflows.
31+
ref: ${{ github.event.pull_request.merge_commit_sha }}
2832

2933
- name: Extract Version from PR Title
3034
env:
@@ -66,3 +70,4 @@ jobs:
6670
gh release create "$VERSION" \
6771
--title "$VERSION" \
6872
--notes-file release_notes.md
73+

0 commit comments

Comments
 (0)