Skip to content

Commit ca5eef9

Browse files
committed
ci(codeql): switch to advanced configuration
1 parent b6a35d9 commit ca5eef9

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
---
2-
# For most projects, this workflow file will not need changing; you simply need
3-
# to commit it to your repository.
4-
#
5-
# You may wish to alter this file to override the set of languages analyzed,
6-
# or to provide custom queries or build logic.
7-
#
82
name: "CodeQL"
93

104
on:
@@ -18,58 +12,64 @@ permissions: {}
1812

1913
jobs:
2014
analyze:
21-
name: Analyze
22-
runs-on: ubuntu-latest
23-
# Ignore PRs coming from forks or from dependabot since they don't have the required permissions.
24-
if: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' }}
15+
name: Analyze (${{ matrix.language }})
16+
# Runner size impacts CodeQL analysis time. To learn more, please see:
17+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
18+
# - https://gh.io/supported-runners-and-hardware-resources
19+
# - https://gh.io/using-larger-runners (GitHub.com only)
20+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
21+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
2522
permissions:
23+
# required for all workflows
24+
security-events: write
25+
26+
# required to fetch internal or private CodeQL packs
27+
packages: read
28+
29+
# only required for workflows in private repositories
2630
actions: read
2731
contents: read
28-
security-events: write
2932

3033
strategy:
3134
fail-fast: false
3235
matrix:
33-
language: ["java"]
34-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
35-
# Learn more:
36-
# 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
37-
36+
include:
37+
- language: actions
38+
build-mode: none
39+
- language: java-kotlin
40+
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
41+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
42+
# Use `c-cpp` to analyze code written in C, C++ or both
43+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
44+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
45+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
46+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
47+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
48+
# 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
3849
steps:
3950
- name: Checkout repository
4051
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4152

53+
# Add any setup steps before running the `github/codeql-action/init` action.
54+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
55+
# or others). This is typically only required for manual builds.
56+
# - name: Setup runtime (example)
57+
# uses: actions/setup-example@v1
58+
4259
# Initializes the CodeQL tools for scanning.
4360
- name: Initialize CodeQL
4461
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
4562
with:
4663
languages: ${{ matrix.language }}
64+
build-mode: ${{ matrix.build-mode }}
4765
# If you wish to specify custom queries, you can do so here or in a config file.
4866
# By default, queries listed here will override any specified in a config file.
4967
# Prefix the list here with "+" to use these queries and those in the config file.
50-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
51-
queries: +security-and-quality
5268

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Set up JDK
56-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
57-
with:
58-
distribution: temurin
59-
java-version: 21
60-
- name: Autobuild
61-
uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
62-
63-
# ℹ️ Command-line programs to run using the OS shell.
64-
# 📚 https://git.io/JvXDl
65-
66-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
67-
# and modify them (or add more) to build your code if your project
68-
# uses a compiled language
69-
70-
#- run: |
71-
# make bootstrap
72-
# make release
69+
# 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
70+
# queries: security-extended,security-and-quality
7371

7472
- name: Perform CodeQL Analysis
7573
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
74+
with:
75+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)