Skip to content

Commit c74879f

Browse files
authored
Update codeql.yml
1 parent afaaf1c commit c74879f

File tree

1 file changed

+45
-26
lines changed

1 file changed

+45
-26
lines changed

.github/workflows/codeql.yml

+45-26
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,79 @@
1111
#
1212
name: "CodeQL"
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
on:
19+
push:
20+
branches: [ "main" ]
21+
paths:
22+
- "go.mod"
23+
- "go.sum"
24+
- "**.go"
25+
- .github/workflows/codeql.yml
26+
pull_request:
27+
branches: [ "main" ]
28+
paths:
29+
- "go.mod"
30+
- "go.sum"
31+
- "**.go"
32+
- .github/workflows/codeql.yml
1533
schedule:
16-
- cron: '21 13 * * 4'
34+
- cron: '32 4 * * 1'
1735

1836
jobs:
1937
analyze:
2038
name: Analyze
21-
runs-on: ubuntu-latest
39+
runs-on: ubuntu-latest-16-cores
40+
permissions:
41+
actions: read
42+
contents: read
43+
security-events: write
2244

2345
strategy:
2446
fail-fast: false
2547
matrix:
2648
language: [ 'go' ]
27-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
28-
# Learn more:
29-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
49+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
50+
# Use only 'java' to analyze code written in Java, Kotlin or both
51+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
52+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3053

3154
steps:
3255
- name: Checkout repository
33-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
3457

3558
# Initializes the CodeQL tools for scanning.
3659
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v1
60+
uses: github/codeql-action/init@v3
3861
with:
3962
languages: ${{ matrix.language }}
4063
# If you wish to specify custom queries, you can do so here or in a config file.
4164
# By default, queries listed here will override any specified in a config file.
4265
# Prefix the list here with "+" to use these queries and those in the config file.
43-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44-
queries: security-and-quality
4566

46-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
67+
# 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
68+
# queries: security-extended,security-and-quality
69+
70+
71+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
4772
# If this step fails, then you should remove it and run the build manually (see below)
4873
- name: Autobuild
49-
uses: github/codeql-action/autobuild@v1
74+
uses: github/codeql-action/autobuild@v3
5075

5176
# ℹ️ Command-line programs to run using the OS shell.
52-
# 📚 https://git.io/JvXDl
77+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
5378

54-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
55-
# and modify them (or add more) to build your code if your project
56-
# uses a compiled language
79+
# If the Autobuild fails above, remove it and uncomment the following three lines.
80+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
5781

58-
#- run: |
59-
# make bootstrap
60-
# make release
82+
# - run: |
83+
# echo "Run, Build Application using script"
84+
# ./location_of_script_within_repo/buildscript.sh
6185

6286
- name: Perform CodeQL Analysis
63-
uses: github/codeql-action/analyze@v1
64-
65-
- name: Print SARIF file contents after analysis
66-
run: |
67-
for f in $(ls "/home/runner/work/deploy/results"); do
68-
echo -e "\\n/home/runner/work/deploy/results/$f:";
69-
# cat "/home/runner/work/deploy/results/$f";
70-
done
87+
uses: github/codeql-action/analyze@v3
88+
with:
89+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)