Skip to content

Commit 1ff6d95

Browse files
authored
[CI] Do not run nightly workflows on forked repos (#936)
1 parent 726dc42 commit 1ff6d95

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/nightly_build.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ on:
2424

2525
jobs:
2626
build-wheel-linux:
27+
# Don't run on forked repos.
28+
if: github.repository_owner == 'pytorch'
2729
runs-on: ubuntu-18.04
2830
strategy:
2931
matrix:
@@ -61,6 +63,8 @@ jobs:
6163
path: dist/*.whl
6264

6365
build-wheel-mac:
66+
# Don't run on forked repos.
67+
if: github.repository_owner == 'pytorch'
6468
runs-on: macos-latest
6569
strategy:
6670
matrix:
@@ -91,6 +95,8 @@ jobs:
9195
path: dist/*.whl
9296

9397
test-wheel-mac:
98+
# Don't run on forked repos.
99+
if: github.repository_owner == 'pytorch'
94100
needs: build-wheel-mac
95101
runs-on: macos-latest
96102
strategy:
@@ -138,6 +144,8 @@ jobs:
138144
exit $EXIT_STATUS
139145
140146
upload-wheel-linux:
147+
# Don't run on forked repos.
148+
if: github.repository_owner == 'pytorch'
141149
needs: test-wheel-linux
142150
runs-on: ubuntu-18.04
143151
strategy:
@@ -167,6 +175,8 @@ jobs:
167175
--verbose
168176
169177
upload-wheel-mac:
178+
# Don't run on forked repos.
179+
if: github.repository_owner == 'pytorch'
170180
needs: test-wheel-mac
171181
runs-on: macos-latest
172182
strategy:
@@ -193,6 +203,8 @@ jobs:
193203
--verbose
194204
195205
test-wheel-linux:
206+
# Don't run on forked repos.
207+
if: github.repository_owner == 'pytorch'
196208
needs: build-wheel-linux
197209
runs-on: ubuntu-18.04
198210
strategy:
@@ -254,8 +266,10 @@ jobs:
254266
exit $EXIT_STATUS
255267
256268
build-wheel-windows:
269+
# Don't run on forked repos.
270+
if: github.repository_owner == 'pytorch'
257271
runs-on: windows-latest
258-
strategy:
272+
strategy:
259273
matrix:
260274
python_version: [["3.7", "3.7"], ["3.8", "3.8"], ["3.9", "3.9"], ["3.10", "3.10.3"]]
261275
steps:
@@ -284,6 +298,8 @@ jobs:
284298
path: dist/*.whl
285299

286300
test-wheel-windows:
301+
# Don't run on forked repos.
302+
if: github.repository_owner == 'pytorch'
287303
needs: build-wheel-windows
288304
runs-on: windows-latest
289305
strategy:
@@ -336,6 +352,8 @@ jobs:
336352
exit $EXIT_STATUS
337353
338354
upload-wheel-windows:
355+
# Don't run on forked repos.
356+
if: github.repository_owner == 'pytorch'
339357
needs: test-wheel-windows
340358
runs-on: windows-latest
341359
strategy:

0 commit comments

Comments
 (0)