Skip to content

Commit b5c637c

Browse files
committed
Update CodeQL workflow
1 parent 3d41684 commit b5c637c

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
branches:
1010
- main
1111
schedule:
12-
- cron: "16 6 * * 4" # run at 6:16am UTC on Thursdays
12+
- cron: "16 6 * * 4" # run every Thursday at 06:16 UTC
1313

1414
concurrency:
1515
group: ${{ github.ref_name }}-codeql
@@ -21,58 +21,53 @@ permissions:
2121
jobs:
2222
analyze:
2323
name: Analyze
24-
runs-on: ubuntu-24.04
24+
runs-on: ubuntu-22.04
2525
permissions:
26-
actions: read
27-
contents: read
28-
security-events: write
26+
actions: read # for github/codeql-action/init to get workflow details
27+
contents: read # for actions/checkout to fetch code
28+
security-events: write # for github/codeql-action/autobuild to send a status report
29+
packages: read # required to fetch internal or private CodeQL packs
2930

3031
strategy:
3132
fail-fast: false
3233
matrix:
33-
language: ["go", "python"]
34-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
35-
# Use only 'java' to analyze code written in Java, Kotlin or both
36-
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
37-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34+
include:
35+
- language: go
36+
build-mode: autobuild
37+
- language: python
38+
build-mode: none
39+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
40+
# Use `c-cpp` to analyze code written in C, C++ or both
41+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
42+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
43+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
44+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
45+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
46+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
3847

3948
steps:
4049
- name: Checkout repository
4150
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4251

52+
- name: Setup Golang Environment
53+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
54+
with:
55+
go-version: stable
56+
if: matrix.language == 'go'
57+
4358
# Initializes the CodeQL tools for scanning.
4459
- name: Initialize CodeQL
4560
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
4661
with:
4762
languages: ${{ matrix.language }}
63+
build-mode: ${{ matrix.build-mode }}
4864
# If you wish to specify custom queries, you can do so here or in a config file.
4965
# By default, queries listed here will override any specified in a config file.
5066
# Prefix the list here with "+" to use these queries and those in the config file.
5167

5268
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5369
# queries: security-extended,security-and-quality
5470

55-
- name: Setup Golang Environment
56-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
57-
with:
58-
go-version: stable
59-
if: matrix.language == 'go'
60-
61-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
62-
# If this step fails, then you should remove it and run the build manually (see below)
63-
- name: Autobuild
64-
uses: github/codeql-action/autobuild@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
65-
66-
# ℹ️ Command-line programs to run using the OS shell.
67-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
68-
69-
# If the Autobuild fails above, remove it and uncomment the following three lines.
70-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
71-
72-
# - run: |
73-
# echo "Run, Build Application using script"
74-
# ./location_of_script_within_repo/buildscript.sh
75-
7671
- name: Perform CodeQL Analysis
7772
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
7873
with:

0 commit comments

Comments
 (0)