Skip to content

Commit b846407

Browse files
authored
Do not run CI on forked repos (#1681)
1 parent 7da96d1 commit b846407

File tree

7 files changed

+9
-2
lines changed

7 files changed

+9
-2
lines changed

.github/workflows/build_docs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defaults:
2121

2222
jobs:
2323
build_docs:
24+
if: github.repository_owner == 'pytorch'
2425
runs-on: ubuntu-latest
2526
strategy:
2627
matrix:
@@ -57,7 +58,7 @@ jobs:
5758
doc-preview:
5859
runs-on: [self-hosted, linux.2xlarge]
5960
needs: build_docs
60-
if: ${{ github.event_name == 'pull_request' }}
61+
if: ${{ github.repository_owner == 'pytorch' && github.event_name == 'pull_request' }}
6162
steps:
6263
- name: Checkout
6364
uses: actions/checkout@v3
@@ -82,7 +83,7 @@ jobs:
8283
upload:
8384
runs-on: ubuntu-latest
8485
needs: build_docs
85-
if: github.repository == 'pytorch/torchtune' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
86+
if: github.repository_owner == 'pytorch' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
8687
environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docs-push' || '' }}
8788
steps:
8889
- name: Checkout

.github/workflows/build_linux_wheels.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ permissions:
1717

1818
jobs:
1919
generate-matrix:
20+
if: github.repository_owner == 'pytorch'
2021
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
2122
with:
2223
package-type: wheel

.github/workflows/gpu_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ defaults:
2323

2424
jobs:
2525
gpu_test:
26+
if: github.repository_owner == 'pytorch'
2627
runs-on: linux.8xlarge.nvidia.gpu
2728
strategy:
2829
matrix:

.github/workflows/lint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ defaults:
1515

1616
jobs:
1717
lint:
18+
if: github.repository_owner == 'pytorch'
1819
runs-on: ubuntu-latest
1920
strategy:
2021
matrix:

.github/workflows/recipe_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defaults:
2121

2222
jobs:
2323
recipe_test:
24+
if: github.repository_owner == 'pytorch'
2425
runs-on: ubuntu-latest
2526
strategy:
2627
matrix:

.github/workflows/regression_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ defaults:
1919

2020
jobs:
2121
regression_test:
22+
if: github.repository_owner == 'pytorch'
2223
runs-on: linux.g5.12xlarge.nvidia.gpu
2324
strategy:
2425
matrix:

.github/workflows/unit_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ defaults:
1515

1616
jobs:
1717
unit_tests:
18+
if: github.repository_owner == 'pytorch'
1819
runs-on: ubuntu-latest
1920
strategy:
2021
matrix:

0 commit comments

Comments
 (0)