Skip to content

CodeQL

CodeQL #324

Workflow file for this run

name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
schedule:
# Weekly scan, Mondays 06:42 UTC, to catch new queries Google/GitHub publish.
- cron: '42 6 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
actions: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
# java-kotlin is temporarily disabled: CodeQL <= 2.26.1 rejects
# Kotlin 2.4.10 ("Kotlin version 2.4.10 is too recent"), so the
# traced build fails and no analysis ever runs. Support (ceiling
# 2.4.20) is already merged upstream and ships with the next CLI
# release, which codeql-action@v4 picks up automatically.
# Once a CodeQL CLI newer than 2.26.1 is out, uncomment to
# re-enable and verify Analyze (java-kotlin) goes green.
# - language: java-kotlin
# build-mode: manual
- language: actions
build-mode: none
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up JDK 21
if: matrix.language == 'java-kotlin'
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Cache Gradle
if: matrix.language == 'java-kotlin'
uses: actions/cache@v6
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality
- name: Build (java-kotlin)
if: matrix.language == 'java-kotlin'
run: |
chmod +x gradlew
./gradlew compileKotlinJvm --no-daemon --no-build-cache --stacktrace
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: /language:${{ matrix.language }}