Skip to content

Commit 329c576

Browse files
authored
Do not run nightly workflows on forks. (#15)
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.
1 parent f57e99e commit 329c576

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

.github/workflows/mark_stale.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212

1313
jobs:
1414
stale:
15+
if: |
16+
github.event_name == 'workflow_dispatch' ||
17+
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
1518
1619
runs-on: ubuntu-latest
1720
permissions:

.github/workflows/nightly_generative_api.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212

1313
jobs:
1414
run-generative-api-examples:
15+
if: |
16+
github.event_name == 'workflow_dispatch' ||
17+
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
18+
1519
name: Generative API Examples
1620
uses: ./.github/workflows/generative_api_examples.yml
1721
with:

.github/workflows/nightly_model_coverage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212

1313
jobs:
1414
run-model-coverage:
15+
if: |
16+
github.event_name == 'workflow_dispatch' ||
17+
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
18+
1519
name: Model Coverage (nightly)
1620
uses: ./.github/workflows/model_coverage.yml
1721
secrets: inherit

.github/workflows/nightly_pip_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
matrix:
1717
python-version: ["3.9", "3.10", "3.11"]
1818

19+
if: |
20+
github.event_name == 'workflow_dispatch' ||
21+
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
22+
1923
runs-on: ubuntu-latest
2024
steps:
2125
- uses: actions/setup-python@v4

.github/workflows/nightly_unittests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212

1313
jobs:
1414
run-unittests-python:
15+
if: |
16+
github.event_name == 'workflow_dispatch' ||
17+
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch') # don't run in forks.
18+
1519
name: Unit Tests Python
1620
uses: ./.github/workflows/unittests_python.yml
1721
with:

0 commit comments

Comments
 (0)