Skip to content

Commit 292f073

Browse files
sjmonsonCopilot
andauthored
Revert pull_request_target (#225)
`pull_request_target` has not been the drop-in replacement it promises to be. Revert its addition and disable build jobs for external PRs. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8a4e408 commit 292f073

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

.github/workflows/development.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Development
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, synchronize, reopened]
66

77
jobs:
@@ -12,8 +12,6 @@ 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 }}"
1715
- name: Set up Python
1816
uses: actions/setup-python@v5
1917
with:
@@ -30,8 +28,6 @@ jobs:
3028
steps:
3129
- name: Check out code
3230
uses: actions/checkout@v4
33-
with:
34-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
3531

3632
- name: Install dependencies
3733
run: npm ci
@@ -46,8 +42,6 @@ jobs:
4642
python: ["3.9", "3.13"]
4743
steps:
4844
- uses: actions/checkout@v4
49-
with:
50-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
5145
- name: Set up Python
5246
uses: actions/setup-python@v5
5347
with:
@@ -64,8 +58,6 @@ jobs:
6458
steps:
6559
- name: Check out code
6660
uses: actions/checkout@v4
67-
with:
68-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
6961

7062
- name: Install dependencies
7163
run: npm ci
@@ -80,8 +72,6 @@ jobs:
8072
python: ["3.9"]
8173
steps:
8274
- uses: actions/checkout@v4
83-
with:
84-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
8575
- name: Set up Python
8676
uses: actions/setup-python@v5
8777
with:
@@ -98,8 +88,6 @@ jobs:
9888
steps:
9989
- name: Check out code
10090
uses: actions/checkout@v4
101-
with:
102-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
10391

10492
- name: Install dependencies
10593
run: npm ci
@@ -114,8 +102,6 @@ jobs:
114102
python: ["3.9", "3.13"]
115103
steps:
116104
- uses: actions/checkout@v4
117-
with:
118-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
119105
- name: Set up Python
120106
uses: actions/setup-python@v5
121107
with:
@@ -132,8 +118,6 @@ jobs:
132118
steps:
133119
- name: Check out code
134120
uses: actions/checkout@v4
135-
with:
136-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
137121

138122
- name: Install dependencies
139123
run: npm ci
@@ -148,8 +132,6 @@ jobs:
148132
python: ["3.9", "3.13"]
149133
steps:
150134
- uses: actions/checkout@v4
151-
with:
152-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
153135
- name: Set up Python
154136
uses: actions/setup-python@v5
155137
with:
@@ -166,8 +148,6 @@ jobs:
166148
steps:
167149
- name: Check out code
168150
uses: actions/checkout@v4
169-
with:
170-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
171151

172152
- name: Install dependencies
173153
run: npm ci
@@ -176,6 +156,8 @@ jobs:
176156
run: npm run test:integration
177157

178158
build:
159+
# Only build if the PR branch is local
160+
if: github.event.pull_request.head.repo.full_name == github.repository
179161
runs-on: ubuntu-latest
180162
strategy:
181163
matrix:
@@ -185,7 +167,6 @@ jobs:
185167
uses: actions/checkout@v4
186168
with:
187169
fetch-depth: 0
188-
ref: "${{ github.event.pull_request.merge_commit_sha }}"
189170
- name: Set up Python
190171
uses: actions/setup-python@v5
191172
with:
@@ -228,6 +209,8 @@ jobs:
228209
})
229210
230211
build-and-push-container:
212+
# Only build if the PR branch is local
213+
if: github.event.pull_request.head.repo.full_name == github.repository
231214
runs-on: ubuntu-latest
232215
permissions:
233216
packages: write

0 commit comments

Comments
 (0)