Skip to content

CodeQL

CodeQL #34

Workflow file for this run

name: "CodeQL"
on:
schedule:
- cron: '0 10 * * 1'
jobs:
analyze:
strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: manual
name: "Analyze (${{ matrix.language }})"
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Initialize CodeQL"
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# 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
queries: security-extended,security-and-quality
- name: "Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v3
- name: "Set up JDK"
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: "Make gradle wrapper executable"
run: chmod +x ./gradlew
- name: "Build with Gradle"
run: ./gradlew build
- name: "Perform CodeQL Analysis"
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
output: sarif-results
upload: failure-only
- name: "Filter SARIF"
uses: advanced-security/filter-sarif@v1
with:
patterns: |
+**/*.java
-**/.cache/**
input: sarif-results/java.sarif
output: sarif-results/java.sarif
- name: "Upload SARIF"
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/java.sarif