Skip to content

Commit b68897f

Browse files
authored
fix: resolve CodeQL job OOM and Default Setup conflict
- gradle.properties: add kotlin.daemon.jvmargs=-Xmx2048m to prevent Kotlin compiler OOM (the root cause of the failing run 76567513542) - codeql.yml: add step to disable GitHub Default Setup via gh api before CodeQL init, resolving the SARIF upload conflict caused by having both Default Setup and advanced setup active simultaneously
1 parent 1a5c068 commit b68897f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ jobs:
3131
distribution: 'temurin'
3232
cache: gradle
3333

34+
- name: 🔒 Disable Default Code Scanning Setup
35+
# Advanced setup (this workflow) conflicts with Default Setup when both are active.
36+
# docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
run: |
40+
if api_output=$(gh api repos/${{ github.repository }}/code-scanning/default-setup \
41+
--method PATCH \
42+
-f state=not-configured 2>&1); then
43+
echo "Default setup disabled successfully."
44+
else
45+
echo "Warning: could not disable default setup via API (may already be disabled or token may lack permissions): $api_output"
46+
echo "If this issue persists, manually disable it at: Settings > Code security > CodeQL analysis > Default setup."
47+
fi
48+
3449
- name: 🔎 Initialize CodeQL
3550
uses: github/codeql-action/init@v3
3651
with:

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
99
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10+
kotlin.daemon.jvmargs=-Xmx2048m
1011
# When configured, Gradle will run in incubating parallel mode.
1112
# This option should only be used with decoupled projects. More details, visit
1213
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

0 commit comments

Comments
 (0)