Skip to content

Commit a2d2769

Browse files
authored
Merge pull request libgit2#6342 from libgit2/ethomson/actions_limits
CI: limits actions scheduled workflows to the main repo
2 parents 3847522 + 69c1fe0 commit a2d2769

3 files changed

Lines changed: 41 additions & 36 deletions

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: 0 additions & 36 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 37 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:
@@ -340,3 +348,32 @@ jobs:
340348
run: source/ci/coverity.sh
341349
env:
342350
COVERITY_TOKEN: ${{ secrets.coverity_token }}
351+
352+
codeql:
353+
# Only run scheduled workflows on the main repository; prevents people
354+
# from using build minutes on their forks.
355+
if: github.repository == 'libgit2/libgit2'
356+
357+
name: CodeQL
358+
runs-on: ubuntu-latest
359+
steps:
360+
- name: Check out repository
361+
uses: actions/checkout@v2
362+
with:
363+
fetch-depth: 0
364+
365+
# Initializes the CodeQL tools for scanning.
366+
- name: Initialize CodeQL
367+
uses: github/codeql-action/init@v1
368+
with:
369+
languages: 'cpp'
370+
371+
- name: Build
372+
run: |
373+
mkdir build
374+
cd build
375+
cmake .. -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
376+
cmake --build .
377+
378+
- name: Perform CodeQL Analysis
379+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)