Fix CodeQL workflow after Java 17 update
MODIFY
.github/workflows/nightly-codeql-analysis.yml
.github/workflows/nightly-codeql-analysis.yml
@@ -12,19 +12,24 @@ jobs:
steps:
- uses: actions/checkout@v3
+ - name: Setup Java 17
+ uses: actions/setup-java@v2
+ with:
+ distribution: temurin
+ java-version: 17
+
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: java
- - name: Setup Java
- uses: actions/setup-java@v2
+ - uses: gradle/gradle-build-action@v2
+ env:
+ # see https://github.com/github/codeql-action/issues/972
+ JAVA_TOOL_OPTIONS: "--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
with:
- distribution: temurin
- java-version: 17
-
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
+ # skipping build cache is needed so that all modules will be analyzed
+ arguments: assemble --no-build-cache
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

Fix CodeQL workflow after Java 17 update (#5639)