-
Notifications
You must be signed in to change notification settings - Fork 360
67 lines (63 loc) · 1.93 KB
/
lint-codeql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: codeql
on:
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
push:
branches:
- main
paths-ignore:
- 'docs/**'
schedule:
- cron: "45 6 * * 3"
permissions: read-all
jobs:
check_changes:
name: Deduce required tests from code changes
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-22.04
outputs:
go-changes: ${{ steps.go-changes.outputs.src }}
steps:
- name: Checkout code
if: ${{ !github.event.pull_request }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: Check code changes
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
id: go-changes
with:
base: ${{ github.event.pull_request.base.sha }}
ref: ${{ github.event.pull_request.head.sha }}
filters: |
src:
- .github/workflows/lint-codeql.yaml
- '**/*.go'
- 'go.mod'
- 'go.sum'
analyze:
needs: check_changes
if: ${{ needs.check_changes.outputs.go-changes == 'true' || github.event_name != 'pull_request' }}
runs-on: ubuntu-22.04
permissions:
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.22.2'
- name: Initialize CodeQL
uses: github/codeql-action/init@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1