Skip to content

Commit dbbaf08

Browse files
committed
[#1279] update codeql and golang versions
- switch go to manual build mode to fix "Some packages could not be found" - ping go version in the new setup-go action to fix "Invalid Go toolchain version" - update action versions
1 parent 1e20778 commit dbbaf08

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/codeql.yml

+30-7
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,46 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ javascript, go, python ]
23+
include:
24+
- language: go
25+
build-mode: manual
26+
- language: python
27+
build-mode: autobuild
28+
- language: typescript
29+
build-mode: autobuild
2430

2531
steps:
2632
- name: Checkout
27-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
34+
35+
- name: Setup Go
36+
if: ${{ matrix.language == 'go' }}
37+
uses: actions/setup-go@v5
38+
with:
39+
cache-dependency-path: backend/go.sum
40+
go-version: 1.22.5
2841

2942
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
43+
uses: github/codeql-action/init@v3
3144
with:
3245
languages: ${{ matrix.language }}
3346
queries: +security-and-quality
3447

48+
# Remove the tools directory to not perform analysis on go dependencies which results in
49+
# unactionable errors like "use of internal package not allowed", "generic function is missing function body",
50+
# "invalid recursive type: bool refers to itself", "could not import package" and others.
51+
- name: Manual Go Build
52+
if: ${{ matrix.language == 'go' }}
53+
run: |
54+
rake build:agent
55+
rake build:server
56+
sudo rm -r ./tools
57+
3558
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
37-
if: ${{ matrix.language == 'javascript' || matrix.language == 'go' || matrix.language == 'python' }}
59+
if: ${{ matrix.language == 'python' || matrix.language == 'typescript' }}
60+
uses: github/codeql-action/autobuild@v3
3861

3962
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@v2
63+
uses: github/codeql-action/analyze@v3
4164
with:
42-
category: "/language:${{ matrix.language }}"
65+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)