Skip to content

Commit

Permalink
Do not run nightly workflows on forks. (#15)
Browse files Browse the repository at this point in the history
This change can't really be tested until:
 * it is merged: to make sure nothing breaks for the upstream repo
 * forks update to upstream/main: to confirm that workflows are not
   triggered in forks.

BUG=cleanup github workflows.
  • Loading branch information
advaitjain authored May 25, 2024
1 parent f57e99e commit 329c576
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/mark_stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:

jobs:
stale:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
runs-on: ubuntu-latest
permissions:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly_generative_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:

jobs:
run-generative-api-examples:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
name: Generative API Examples
uses: ./.github/workflows/generative_api_examples.yml
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly_model_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:

jobs:
run-model-coverage:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
name: Model Coverage (nightly)
uses: ./.github/workflows/model_coverage.yml
secrets: inherit
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly_pip_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
matrix:
python-version: ["3.9", "3.10", "3.11"]

if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly_unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:

jobs:
run-unittests-python:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
name: Unit Tests Python
uses: ./.github/workflows/unittests_python.yml
with:
Expand Down

0 comments on commit 329c576

Please sign in to comment.