Skip to content

Commit 367867f

Browse files
committed
ci: Stop nightly CI workflows on user forks (#2074)
ci: Stop nightly analysis and scorecard workflows on user forks Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent af6f29a commit 367867f

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.github/workflows/analysis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ jobs:
4949

5050
aswf:
5151
name: "SonarCloud Analysis"
52-
if: |
53-
github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage'
52+
if: github.event.repository.fork == false
5453
strategy:
5554
fail-fast: false
5655
matrix:

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ on:
2929
schedule:
3030
# Full nightly build, for the main project repo (not for forks)
3131
- cron: "0 6 * * *"
32-
if: github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage'
3332
workflow_dispatch:
3433
# This allows manual triggering of the workflow from the web
3534

@@ -44,7 +43,7 @@ concurrency:
4443
jobs:
4544

4645
aswf-old:
47-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
46+
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
4847
name: "VFX${{matrix.vfxyear}} ${{matrix.desc}}"
4948
strategy:
5049
fail-fast: false
@@ -195,7 +194,7 @@ jobs:
195194
196195
197196
linux:
198-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
197+
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
199198
name: "${{matrix.desc}}"
200199
uses: ./.github/workflows/build-steps.yml
201200
with:
@@ -516,7 +515,7 @@ jobs:
516515

517516

518517
macos:
519-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'optix-only') }}
518+
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'optix-only') }}
520519
name: "${{matrix.desc}}"
521520
uses: ./.github/workflows/build-steps.yml
522521
with:
@@ -651,7 +650,7 @@ jobs:
651650

652651

653652
optix-gpu:
654-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
653+
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
655654
name: "${{matrix.desc}}"
656655
uses: ./.github/workflows/build-steps.yml
657656
with:

.github/workflows/scorecards.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ concurrency:
2727
jobs:
2828
analysis:
2929
name: Scorecards analysis
30-
if: |
31-
github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage'
30+
if: github.event.repository.fork == false
3231
runs-on: ubuntu-latest
3332
permissions:
3433
# Needed to upload the results to code-scanning dashboard.

0 commit comments

Comments
 (0)