Skip to content

Commit 65c5cb2

Browse files
authored
Merge pull request #67 from kaifcoder/copilot/fix-codeql-autobuild-error
[WIP] Fix CodeQL workflow by replacing autobuild with Maven commands
2 parents bfcca33 + 8cb923a commit 65c5cb2

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/codeql.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,25 @@ jobs:
5757
# By default, queries listed here will override any specified in a config file.
5858
# Prefix the list here with "+" to use these queries and those in the config file.
5959

60-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
61-
# If this step fails, then you should remove it and run the build manually (see below)
60+
# Setup Java and Maven for Java language only
61+
- name: Set up Temurin JDK
62+
if: matrix.language == 'java'
63+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
64+
with:
65+
distribution: 'temurin'
66+
java-version: '21'
67+
cache: 'maven'
68+
69+
# Build Java project explicitly for Java language
70+
- name: Build with Maven
71+
if: matrix.language == 'java'
72+
working-directory: templates/spring-boot
73+
run: mvn -B -ntp package -DskipTests
74+
75+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go).
76+
# For Java, we use explicit Maven build steps above instead.
6277
- name: Autobuild
78+
if: matrix.language != 'java'
6379
uses: github/codeql-action/autobuild@bffd034ab1518ad839a542b8a7356e13a240e076 # v3.31.7
6480

6581
# ℹ️ Command-line programs to run using the OS shell.

0 commit comments

Comments
 (0)