Skip to content

Commit e72af29

Browse files
committed
actions: limit secheduled workflows to our main repo
Only run scheduled workflows on the main repository; prevents people from using build minutes on their forks.
1 parent 3847522 commit e72af29

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/benchmark.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
# targets and their details. Then we build either in a docker container
1212
# (Linux) or on the actual hosts (macOS, Windows).
1313
build:
14+
# Only run scheduled workflows on the main repository; prevents people
15+
# from using build minutes on their forks.
16+
if: github.repository == 'libgit2/libgit2'
17+
1418
strategy:
1519
matrix:
1620
platform:

.github/workflows/codeql.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010

1111
jobs:
1212
analyze:
13+
# Only run scheduled workflows on the main repository; prevents people
14+
# from using build minutes on their forks.
15+
if: github.repository == 'libgit2/libgit2'
16+
1317
name: Analyze
1418
runs-on: ubuntu-latest
1519

@@ -30,7 +34,7 @@ jobs:
3034
mkdir build
3135
cd build
3236
cmake .. -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
33-
cmake --build .
37+
cmake --build .
3438
3539
- name: Perform CodeQL Analysis
3640
uses: github/codeql-action/analyze@v1

.github/workflows/nightly.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
# targets and their details. Then we build either in a docker container
1616
# (Linux) or on the actual hosts (macOS, Windows).
1717
build:
18+
# Only run scheduled workflows on the main repository; prevents people
19+
# from using build minutes on their forks.
20+
if: github.repository == 'libgit2/libgit2'
21+
1822
strategy:
1923
matrix:
2024
platform:
@@ -321,6 +325,10 @@ jobs:
321325
shell: bash
322326

323327
coverity:
328+
# Only run scheduled workflows on the main repository; prevents people
329+
# from using build minutes on their forks.
330+
if: github.repository == 'libgit2/libgit2'
331+
324332
name: Coverity
325333
runs-on: ubuntu-latest
326334
steps:

0 commit comments

Comments
 (0)