|
46 | 46 | - language: actions |
47 | 47 | build-mode: none |
48 | 48 | - language: csharp |
49 | | - build-mode: none |
| 49 | + build-mode: autobuild |
| 50 | + # Using autobuild to improve analysis quality (dependency resolution). |
| 51 | + # If autobuild fails (Unity packages may not have .csproj files), |
| 52 | + # consider switching to 'none' and accepting lower quality metrics. |
50 | 53 | # c-cpp and Swift analysis removed: Unity SDKs don't include build projects in the repo |
51 | 54 | # (Unity generates Xcode/Android projects during build). CodeQL's C/C++ autobuilder |
52 | 55 | # doesn't recognize .mm (Objective-C++) files as source files. The minimal native |
|
66 | 69 | # Add any setup steps before running the `github/codeql-action/init` action. |
67 | 70 | # This includes steps like installing compilers or runtimes (`actions/setup-node` |
68 | 71 | # or others). This is typically only required for manual builds. |
69 | | - # - name: Setup runtime (example) |
70 | | - # uses: actions/setup-example@v1 |
| 72 | + - name: Setup .NET |
| 73 | + if: matrix.language == 'csharp' |
| 74 | + uses: actions/setup-dotnet@v5 |
| 75 | + with: |
| 76 | + dotnet-version: "6.0.x" |
71 | 77 |
|
72 | 78 | # Initializes the CodeQL tools for scanning. |
73 | 79 | - name: Initialize CodeQL |
|
83 | 89 | # Consider enabling security queries for better coverage: |
84 | 90 | # queries: security-extended,security-and-quality |
85 | 91 |
|
86 | | - # If the analyze step fails for one of the languages you are analyzing with |
87 | | - # "We were unable to automatically build your code", modify the matrix above |
88 | | - # to set the build mode to "manual" for that language. Then modify this step |
89 | | - # to build your code. |
90 | | - # ℹ️ Command-line programs to run using the OS shell. |
91 | | - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
92 | | - - name: Run manual build steps |
93 | | - if: matrix.build-mode == 'manual' |
94 | | - shell: bash |
95 | | - run: | |
96 | | - echo 'If you are using a "manual" build mode for one or more of the' \ |
97 | | - 'languages you are analyzing, replace this with the commands to build' \ |
98 | | - 'your code, for example:' |
99 | | - echo ' make bootstrap' |
100 | | - echo ' make release' |
101 | | - exit 1 |
102 | | -
|
103 | 92 | - name: Perform CodeQL Analysis |
104 | 93 | uses: github/codeql-action/analyze@v4 |
105 | 94 | with: |
|
0 commit comments