Skip to content

Commit b75fc4c

Browse files
authored
fix(ci): Prevent workflows from automatically running on forks (#34408)
1 parent 7e97e01 commit b75fc4c

File tree

8 files changed

+29
-0
lines changed

8 files changed

+29
-0
lines changed

.github/workflows/tests_bidi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818
jobs:
1919
test_bidi:
2020
name: BiDi
21+
if: github.repository == 'microsoft/playwright'
2122
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
2223
runs-on: ubuntu-24.04
2324
permissions:

.github/workflows/tests_components.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
jobs:
2121
test_components:
2222
name: ${{ matrix.os }} - Node.js ${{ matrix.node-version }}
23+
if: github.repository == 'microsoft/playwright'
2324
strategy:
2425
fail-fast: false
2526
matrix:

.github/workflows/tests_others.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
jobs:
2222
test_stress:
2323
name: Stress - ${{ matrix.os }}
24+
if: github.repository == 'microsoft/playwright'
2425
strategy:
2526
fail-fast: false
2627
matrix:
@@ -57,6 +58,7 @@ jobs:
5758

5859
test_webview2:
5960
name: WebView2
61+
if: github.repository == 'microsoft/playwright'
6062
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
6163
runs-on: windows-2022
6264
permissions:
@@ -87,6 +89,7 @@ jobs:
8789

8890
test_clock_frozen_time_linux:
8991
name: time library - ${{ matrix.clock }}
92+
if: github.repository == 'microsoft/playwright'
9093
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
9194
permissions:
9295
id-token: write # This is required for OIDC login (azure/login) to succeed
@@ -112,6 +115,7 @@ jobs:
112115

113116
test_clock_frozen_time_test_runner:
114117
name: time test runner - ${{ matrix.clock }}
118+
if: github.repository == 'microsoft/playwright'
115119
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
116120
runs-on: ubuntu-22.04
117121
permissions:
@@ -136,6 +140,7 @@ jobs:
136140

137141
test_electron:
138142
name: Electron - ${{ matrix.os }}
143+
if: github.repository == 'microsoft/playwright'
139144
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
140145
strategy:
141146
fail-fast: false

.github/workflows/tests_primary.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ env:
2727
jobs:
2828
test_linux:
2929
name: ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }})
30+
if: github.repository == 'microsoft/playwright'
3031
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
3132
strategy:
3233
fail-fast: false
@@ -59,6 +60,7 @@ jobs:
5960

6061
test_linux_chromium_tot:
6162
name: ${{ matrix.os }} (chromium tip-of-tree)
63+
if: github.repository == 'microsoft/playwright'
6264
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
6365
strategy:
6466
fail-fast: false
@@ -83,6 +85,7 @@ jobs:
8385

8486
test_test_runner:
8587
name: Test Runner
88+
if: github.repository == 'microsoft/playwright'
8689
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
8790
strategy:
8891
fail-fast: false
@@ -127,6 +130,7 @@ jobs:
127130

128131
test_web_components:
129132
name: Web Components
133+
if: github.repository == 'microsoft/playwright'
130134
runs-on: ubuntu-latest
131135
steps:
132136
- uses: actions/checkout@v4
@@ -162,6 +166,7 @@ jobs:
162166

163167
test_vscode_extension:
164168
name: VSCode Extension
169+
if: github.repository == 'microsoft/playwright'
165170
runs-on: ubuntu-latest
166171
env:
167172
PWTEST_BOT_NAME: "vscode-extension"
@@ -198,6 +203,7 @@ jobs:
198203

199204
test_package_installations:
200205
name: "Installation Test ${{ matrix.os }}"
206+
if: github.repository == 'microsoft/playwright'
201207
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
202208
strategy:
203209
fail-fast: false

.github/workflows/tests_secondary.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ permissions:
2626
jobs:
2727
test_linux:
2828
name: ${{ matrix.os }} (${{ matrix.browser }})
29+
if: github.repository == 'microsoft/playwright'
2930
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
3031
strategy:
3132
fail-fast: false
@@ -46,6 +47,7 @@ jobs:
4647

4748
test_mac:
4849
name: ${{ matrix.os }} (${{ matrix.browser }})
50+
if: github.repository == 'microsoft/playwright'
4951
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
5052
strategy:
5153
fail-fast: false
@@ -73,6 +75,7 @@ jobs:
7375

7476
test_win:
7577
name: "Windows"
78+
if: github.repository == 'microsoft/playwright'
7679
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
7780
strategy:
7881
fail-fast: false
@@ -92,6 +95,7 @@ jobs:
9295

9396
test-package-installations-other-node-versions:
9497
name: "Installation Test ${{ matrix.os }} (${{ matrix.node_version }})"
98+
if: github.repository == 'microsoft/playwright'
9599
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
96100
runs-on: ${{ matrix.os }}
97101
strategy:
@@ -125,6 +129,7 @@ jobs:
125129

126130
headed_tests:
127131
name: "headed ${{ matrix.browser }} (${{ matrix.os }})"
132+
if: github.repository == 'microsoft/playwright'
128133
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
129134
strategy:
130135
fail-fast: false
@@ -151,6 +156,7 @@ jobs:
151156

152157
transport_linux:
153158
name: "Transport"
159+
if: github.repository == 'microsoft/playwright'
154160
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
155161
strategy:
156162
fail-fast: false
@@ -172,6 +178,7 @@ jobs:
172178

173179
tracing_linux:
174180
name: Tracing ${{ matrix.browser }} ${{ matrix.channel }}
181+
if: github.repository == 'microsoft/playwright'
175182
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
176183
strategy:
177184
fail-fast: false
@@ -199,6 +206,7 @@ jobs:
199206

200207
test_chromium_channels:
201208
name: Test ${{ matrix.channel }} on ${{ matrix.runs-on }}
209+
if: github.repository == 'microsoft/playwright'
202210
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
203211
runs-on: ${{ matrix.runs-on }}
204212
strategy:
@@ -221,6 +229,7 @@ jobs:
221229

222230
chromium_tot:
223231
name: Chromium tip-of-tree ${{ matrix.os }}${{ matrix.headed }}
232+
if: github.repository == 'microsoft/playwright'
224233
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
225234
runs-on: ${{ matrix.os }}
226235
strategy:
@@ -243,6 +252,7 @@ jobs:
243252

244253
chromium_tot_headless_shell:
245254
name: Chromium tip-of-tree headless-shell-${{ matrix.os }}
255+
if: github.repository == 'microsoft/playwright'
246256
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
247257
runs-on: ${{ matrix.os }}
248258
strategy:
@@ -264,6 +274,7 @@ jobs:
264274

265275
firefox_beta:
266276
name: Firefox Beta ${{ matrix.os }}
277+
if: github.repository == 'microsoft/playwright'
267278
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
268279
runs-on: ${{ matrix.os }}
269280
strategy:
@@ -285,6 +296,7 @@ jobs:
285296

286297
build-playwright-driver:
287298
name: "build-playwright-driver"
299+
if: github.repository == 'microsoft/playwright'
288300
runs-on: ubuntu-24.04
289301
steps:
290302
- uses: actions/checkout@v4
@@ -298,6 +310,7 @@ jobs:
298310

299311
test_channel_chromium:
300312
name: Test channel=chromium
313+
if: github.repository == 'microsoft/playwright'
301314
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
302315
strategy:
303316
fail-fast: false

.github/workflows/tests_service.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
jobs:
1111
test:
1212
name: "Service"
13+
if: github.repository == 'microsoft/playwright'
1314
strategy:
1415
fail-fast: false
1516
matrix:

.github/workflows/tests_video.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
jobs:
1515
video_linux:
1616
name: "Video Linux"
17+
if: github.repository == 'microsoft/playwright'
1718
environment: allow-uploading-flakiness-results
1819
strategy:
1920
fail-fast: false

.github/workflows/trigger_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
trigger:
1111
name: "trigger"
12+
if: github.repository == 'microsoft/playwright'
1213
runs-on: ubuntu-24.04
1314
steps:
1415
- run: |

0 commit comments

Comments
 (0)