Skip to content

Commit 8623ff0

Browse files
committed
configure CodeQL for Go 1.27
GitHub's managed CodeQL setup currently installs Go 1.26 and forces `GOTOOLCHAIN=local`, so its autobuild cannot analyze a module targeting Go 1.27. Move CodeQL to a repository workflow that installs the Go version from `go.mod`. Use an explicit Go build for reliable extraction while retaining the existing Go and GitHub Actions analyses and weekly schedule.
1 parent f765f4c commit 8623ff0

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

‎.github/workflows/codeql.yaml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
schedule:
9+
- cron: "17 4 * * 1"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
packages: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: actions
26+
build-mode: none
27+
- language: go
28+
build-mode: manual
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v7
33+
34+
- name: Setup Go
35+
if: matrix.language == 'go'
36+
uses: actions/setup-go@v7
37+
with:
38+
check-latest: true
39+
go-version-file: "go.mod"
40+
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v4
43+
with:
44+
build-mode: ${{ matrix.build-mode }}
45+
languages: ${{ matrix.language }}
46+
47+
- name: Build Go
48+
if: matrix.language == 'go'
49+
run: go build ./...
50+
51+
- name: Perform CodeQL analysis
52+
uses: github/codeql-action/analyze@v4
53+
with:
54+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)