Skip to content

chore(ci): add CodeQL analysis workflow#523

Closed
mikepenz wants to merge 1 commit intodevelopfrom
chore/setup-codeql
Closed

chore(ci): add CodeQL analysis workflow#523
mikepenz wants to merge 1 commit intodevelopfrom
chore/setup-codeql

Conversation

@mikepenz
Copy link
Copy Markdown
Owner

@mikepenz mikepenz commented Apr 6, 2026

Summary

  • Adds .github/workflows/codeql.yml for static security analysis via GitHub CodeQL
  • Language: java-kotlin — covers all Kotlin source across library and sample modules
  • Build mode: manual with ./gradlew sample:android:assembleDebug (more reliable than autobuild for KMP/Gradle)
  • Runs on ubuntu-latest — no macOS runner needed since only Android/JVM targets are compiled
  • Triggers on PRs to main/develop and on a weekly schedule (Mondays 08:00 UTC)
  • Results appear in Security → Code Scanning alongside lint SARIF reports

Notes

  • Uses codeql-action@v4 throughout
  • security-events: write + actions: read + contents: read permissions scoped to the job

🤖 Generated with Claude Code

Adds static analysis via GitHub CodeQL for Kotlin code:
- Triggers on PR to main/develop and weekly schedule (Mondays 08:00 UTC)
- Runs on ubuntu-latest (only Android/JVM compilation needed, no macOS required)
- Uses java-kotlin language with manual build mode via assembleDebug
- Results surface in Security → Code Scanning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 6, 2026 12:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to run GitHub CodeQL code scanning for the repository’s Kotlin/Java sources, integrating results into GitHub’s Code Scanning UI.

Changes:

  • Introduces a new CodeQL workflow triggered on PRs to main/develop and on a weekly cron.
  • Initializes CodeQL for java-kotlin and performs a manual Gradle build (sample:android:assembleDebug) before analysis.
  • Scopes job permissions to enable uploading code-scanning results.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +27
java-version: |
17
21
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-java expects a single Java version value; using a YAML block here produces one multiline string (e.g., "17\n21") which can cause the setup step to fail or install an unintended version. Use a single version (likely 17 for Android builds) or a matrix to run the workflow separately per JDK version.

Suggested change
java-version: |
17
21
java-version: '17'

Copilot uses AI. Check for mistakes.
21

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The run: mkdir -p ... ; cp ... uses ;, so the cp will execute even if the mkdir fails. Prefer && or a multiline script with set -euo pipefail so this step fails fast and doesn’t mask environment/setup issues.

Suggested change
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
run: |
set -euo pipefail
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties

Copilot uses AI. Check for mistakes.
@mikepenz
Copy link
Copy Markdown
Owner Author

mikepenz commented Apr 6, 2026

blocked by codeQL not supporting Kotlin 2.3.20

@mikepenz mikepenz closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants