Skip to content

CodeQL Advanced

CodeQL Advanced #98

Workflow file for this run

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '27 20 * * 5'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: java-kotlin
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# ------------------------------------------------------------------
# NEW STEPS: Specific setup for Android (Java/Kotlin) manual builds
# ------------------------------------------------------------------
# 1. Setup Java 17 (Required for modern Android Gradle plugins)
- name: Set up JDK 17
if: matrix.language == 'java-kotlin' && matrix.build-mode == 'manual'
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# 2. Grant permission and build the app
- name: Build Android App
if: matrix.language == 'java-kotlin' && matrix.build-mode == 'manual'
run: |
chmod +x gradlew
./gradlew assembleDebug --no-daemon
# ------------------------------------------------------------------
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"