Skip to content

Commit e1603e9

Browse files
authored
Don't run cron jobs on forks (#7524)
1 parent 01ca6b3 commit e1603e9

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

.github/workflows/installations.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations ${{ matrix.target }} spmbuildonly
7070

7171
catalyst:
72+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
7273
runs-on: macOS-latest
7374
steps:
7475
- uses: actions/checkout@v2

.github/workflows/mlmodeldownloader.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ on:
1212

1313
jobs:
1414
pod-lib-lint:
15-
# Don't run on private repo unless it is a PR.
16-
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
17-
15+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
1816
runs-on: macOS-latest
1917
env:
2018
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -31,12 +29,10 @@ jobs:
3129
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
3230
FirebaseMLModelDownloader/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
3331
- name: Build and test
34-
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }}
32+
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }})
3533

3634
mlmodeldownloader-cron-only:
37-
# Don't run on private repo.
38-
if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
39-
35+
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
4036
runs-on: macos-latest
4137
env:
4238
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -57,8 +53,7 @@ jobs:
5753
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }} --use-static-frameworks
5854

5955
spm:
60-
# Don't run on private repo unless it is a PR.
61-
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
56+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
6257
runs-on: macOS-latest
6358
steps:
6459
- uses: actions/checkout@v2
@@ -71,7 +66,7 @@ jobs:
7166

7267
spm-cron:
7368
# Don't run on private repo.
74-
if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
69+
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
7570
runs-on: macOS-latest
7671
strategy:
7772
matrix:
@@ -86,8 +81,7 @@ jobs:
8681
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseMLModelDownloaderUnit ${{ matrix.target }} spm
8782

8883
catalyst:
89-
# Don't run on private repo unless it is a PR.
90-
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
84+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
9185
runs-on: macOS-latest
9286
steps:
9387
- uses: actions/checkout@v2
@@ -98,7 +92,7 @@ jobs:
9892

9993
mlmodeldownloader-sample-build-test:
10094
# Don't run on private repo unless it is a PR.
101-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
95+
if: github.repository == 'Firebase/firebase-ios-sdk' && (github.event_name == 'schedule' || github.event_name == 'pull_request')
10296
env:
10397
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
10498
runs-on: macos-latest

0 commit comments

Comments
 (0)