Skip to content

CodeQL: own workflow that builds the phone app before scanning its Java - #41

Merged
Torgh merged 1 commit into
mainfrom
codeql-advanced
Oct 24, 2026
Merged

Torgh merged 1 commit into
mainfrom
codeql-advanced

Conversation

@Torgh

@Torgh Torgh commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Why

CodeQL's status page flagged the Java/Kotlin scan: it "completed successfully, but the scan encountered issues" – only 50 % of calls had a known target and 75 % of expressions a known type (threshold 85 %). No security alerts are open; this is about scan quality.

Cause: the default setup scans mobile/android with build-mode none, and Gradle can't resolve the app's dependencies there – Capacitor's cordova.variables.gradle and node_modules/@capacitor/android only exist after bun install and cap sync (the log shows Could not read script …/capacitor-cordova-android-plugins/cordova.variables.gradle).

What changes

  • New .github/workflows/codeql.yml (pull requests, main, weekly):
    • actions and javascript-typescript: build-mode none, as before;
    • java-kotlin: build-mode manual – bun install, build:mobile, cap sync android, gradlew assembleDebug (JDK 21, no keys), so the analysis sees Android and Capacitor.
  • Actions pinned to commits, like CI; Dependabot already updates GitHub Actions.
  • README: one sentence on CodeQL in the CI paragraph.

To switch over

A repository can't run CodeQL's default setup and an advanced workflow at the same time: until the default setup is turned off (Settings → Code security → CodeQL analysis → Switch to advanced, or the API), this workflow's upload step is rejected. Turn it off when merging this.

🤖 Generated with Claude Code

CodeQL's default setup scanned the Android app's Java with build-mode
none, and Gradle could not resolve its dependencies: Capacitor's files
(cordova.variables.gradle, node_modules/@capacitor/android) only exist
after `cap sync`. The scan "encountered issues": 50 % of calls with a
known target and 75 % of expressions with a known type, under the 85 %
thresholds.

This workflow replaces the default setup. Actions and
JavaScript/TypeScript are scanned as before (no build); Java is built
manually – bun install, build:mobile, cap sync, gradlew assembleDebug,
with JDK 21 and no keys – so the analysis sees Android and Capacitor.
It runs on pull requests, on main and weekly; actions are pinned like
in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Torgh
Torgh merged commit bd4c5a6 into main Oct 24, 2026
9 of 12 checks passed
@Torgh
Torgh deleted the codeql-advanced branch October 24, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant