Skip to content

Commit d7128a1

Browse files
authored
chore: skip CodeQL if go files have no changes (#636)
Signed-off-by: Ling Samuel <[email protected]>
1 parent d8854c3 commit d7128a1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,31 @@ on:
2929
- cron: '25 5 * * 5'
3030

3131
jobs:
32+
changes:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
go: ${{ steps.filter.outputs.go }}
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
with:
40+
submodules: recursive
41+
42+
- uses: ./.github/actions/paths-filter
43+
id: filter
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
filters: |
47+
go:
48+
- '*.go'
49+
- '**/*.go'
3250
analyze:
3351
name: Analyze
3452
runs-on: ubuntu-latest
3553

54+
needs: changes
55+
if: |
56+
(needs.changes.outputs.go == 'true')
3657
strategy:
3758
fail-fast: false
3859
matrix:

0 commit comments

Comments
 (0)