Skip to content

Commit ade5d6e

Browse files
committed
Disable test workflow run by cron on forks
1 parent a85de91 commit ade5d6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ on:
2020

2121
env:
2222
UV_SYSTEM_PYTHON: 1
23+
# Run scheduled jobs only on the main repository (disable cron on forks)
24+
RUN_CONDITION: ${{ github.repository_owner == 'fastapi' || github.event_name != 'schedule' }}
2325

2426
jobs:
2527
test:
28+
if: ${{ env.RUN_CONDITION }}
2629
strategy:
2730
matrix:
2831
os: [ ubuntu-latest, windows-latest, macos-latest ]
@@ -135,7 +138,7 @@ jobs:
135138

136139
# https://github.com/marketplace/actions/alls-green#why
137140
alls-green: # This job does nothing and is only used for the branch protection
138-
if: always()
141+
if: always() && env.RUN_CONDITION
139142
needs:
140143
- coverage-combine
141144
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)