Skip to content

Commit 34ead48

Browse files
sjmonsonDaltheCow
authored andcommitted
Fix checkout target for pull request workflows (#212)
when using `pull_request_target:` the default ref is main so all checks are run from the main branch rather than the PR. This re-targets all checkouts to a generated `merge_commit` which matches the behavior of `pull_request:`. ([ref](actions/checkout#518)) Signed-off-by: dalthecow <[email protected]>
1 parent 8662533 commit 34ead48

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/development.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
python: ["3.9", "3.13"]
1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
1517
- name: Set up Python
1618
uses: actions/setup-python@v5
1719
with:
@@ -47,6 +49,8 @@ jobs:
4749
python: ["3.9", "3.13"]
4850
steps:
4951
- uses: actions/checkout@v4
52+
with:
53+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
5054
- name: Set up Python
5155
uses: actions/setup-python@v5
5256
with:
@@ -82,6 +86,8 @@ jobs:
8286
python: ["3.9"]
8387
steps:
8488
- uses: actions/checkout@v4
89+
with:
90+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
8591
- name: Set up Python
8692
uses: actions/setup-python@v5
8793
with:
@@ -117,6 +123,8 @@ jobs:
117123
python: ["3.9", "3.13"]
118124
steps:
119125
- uses: actions/checkout@v4
126+
with:
127+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
120128
- name: Set up Python
121129
uses: actions/setup-python@v5
122130
with:
@@ -152,6 +160,8 @@ jobs:
152160
python: ["3.9", "3.13"]
153161
steps:
154162
- uses: actions/checkout@v4
163+
with:
164+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
155165
- name: Set up Python
156166
uses: actions/setup-python@v5
157167
with:
@@ -192,6 +202,7 @@ jobs:
192202
uses: actions/checkout@v4
193203
with:
194204
fetch-depth: 0
205+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
195206
- name: Set up Python
196207
uses: actions/setup-python@v5
197208
with:

0 commit comments

Comments
 (0)