Skip to content

Commit 0d6aaf9

Browse files
ci: use autobuild build-mode for CodeQL Go
CodeQL 2.25.x rejects build-mode 'none' for Go ('Go does not support the none build mode; use autobuild or manual'), which failed the initial run. Switch to autobuild and add a SHA-pinned setup-go (go-version-file: go.mod) so the autobuilder uses the project's Go toolchain rather than whatever the runner ships. go build ./... already compiles cleanly, so autobuild succeeds. Signed-off-by: Myasnikov Daniil <[email protected]> Assisted-By: Claude <[email protected]>
1 parent 540c4a1 commit 0d6aaf9

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,26 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
include:
39-
# build-mode "none" extracts Go source without compiling it, so the
40-
# job can never fail on the monorepo's generated files, build tags,
41-
# or the api/apps/v1alpha1 submodule. It still produces real alerts
42-
# and satisfies the OpenSSF Scorecard SAST check. Switch to
43-
# "autobuild" later if deeper, build-aware analysis is wanted.
39+
# Go only supports "autobuild" or "manual" (not "none"). autobuild
40+
# runs the Go build the same way `go build ./...` does — the repo
41+
# already compiles cleanly there, including the committed generated
42+
# files. setup-go below pins the toolchain to the go.mod version so
43+
# autobuild does not fall back to whatever Go the runner ships.
4444
- language: go
45-
build-mode: none
45+
build-mode: autobuild
4646

4747
steps:
4848
- name: Checkout repository
4949
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5050
with:
5151
persist-credentials: false
5252

53+
- name: Set up Go
54+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
55+
with:
56+
go-version-file: go.mod
57+
cache: false
58+
5359
- name: Initialize CodeQL
5460
uses: github/codeql-action/init@03e4368ac7daa2bd82b3e85262f3bf87ee112f57 # v3
5561
with:

0 commit comments

Comments
 (0)