Skip to content

Commit

Permalink
Do not run CI on forked repos
Browse files Browse the repository at this point in the history
  • Loading branch information
janeyx99 committed Sep 25, 2024
1 parent 7eb362c commit b2d1a37
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defaults:

jobs:
build_docs:
if: github.repository_owner == 'pytorch'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
doc-preview:
runs-on: [self-hosted, linux.2xlarge]
needs: build_docs
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.repository_owner == 'pytorch' && github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -82,7 +83,7 @@ jobs:
upload:
runs-on: ubuntu-latest
needs: build_docs
if: github.repository == 'pytorch/torchtune' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
if: github.repository_owner == 'pytorch' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docs-push' || '' }}
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_linux_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissions:

jobs:
generate-matrix:
if: github.repository_owner == 'pytorch'
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gpu_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defaults:

jobs:
gpu_test:
if: github.repository_owner == 'pytorch'
runs-on: linux.8xlarge.nvidia.gpu
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defaults:

jobs:
lint:
if: github.repository_owner == 'pytorch'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/recipe_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defaults:

jobs:
recipe_test:
if: github.repository_owner == 'pytorch'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/regression_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ defaults:

jobs:
regression_test:
if: github.repository_owner == 'pytorch'
runs-on: linux.g5.12xlarge.nvidia.gpu
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defaults:

jobs:
unit_tests:
if: github.repository_owner == 'pytorch'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down

0 comments on commit b2d1a37

Please sign in to comment.