-
Notifications
You must be signed in to change notification settings - Fork 74
48 lines (40 loc) · 1.41 KB
/
codeql-analysis.yml
File metadata and controls
48 lines (40 loc) · 1.41 KB
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
name: "CodeQL"
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '22 2 * * 0'
jobs:
analyze:
name: Analyze
# Dependabot only has read permissions on push i.e. after merging a PR, and that causes failures because it needs
# 'write' permissions to upload the scan report to GitHub. This is a workaround to stop runs after merging a
# Dependabot PR, and always run when it comes from a pull request.
if: ${{ github.actor != 'dependabot[bot]' || github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Manually install the right version of Go
# See https://github.com/github/codeql-action/issues/1842 and https://github.com/github/codeql/issues/13992
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: go
config-file: .github/codeql/codeql-config.yml
build-mode: manual
dependency-caching: true
- name: Build for CodeQL
run: go build -o bin/manager ./cmd
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: '/language:go'