Skip to content

Commit 783e071

Browse files
fix(ci): use buildless mode for CodeQL Unity analysis (#563)
Unity projects don't have standard .NET solution files, so CodeQL's autobuild fails. Switch to buildless mode (build-mode: none) which analyzes C# source code directly without requiring a build. This is the recommended approach for Unity projects and other non-standard C# codebases. Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f2331e0 commit 783e071

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,8 @@ jobs:
4343
config-file: ./.github/codeql/codeql-config.yml
4444
# Use security-and-quality queries for comprehensive analysis
4545
queries: security-and-quality
46-
47-
# Build step for C# - CodeQL needs to observe the build
48-
# For Unity projects, we set up a minimal build environment
49-
- name: Setup .NET
50-
uses: actions/setup-dotnet@v4
51-
with:
52-
dotnet-version: '6.0.x'
53-
54-
# Autobuild attempts to build the project automatically
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v3
46+
# Use buildless mode for Unity projects (no standard .NET build)
47+
build-mode: none
5748

5849
- name: Perform CodeQL Analysis
5950
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)