Skip to content

Commit 8b9989b

Browse files
committed
configure languages
1 parent e40f7e1 commit 8b9989b

File tree

1 file changed

+51
-48
lines changed

1 file changed

+51
-48
lines changed

.github/workflows/codeql.yml

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ name: "CodeQL Advanced"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
18-
branches: [ "main" ]
18+
branches: ["main"]
1919
schedule:
20-
- cron: '32 13 * * 0'
20+
- cron: "32 13 * * 0"
2121

2222
jobs:
2323
analyze:
@@ -27,7 +27,7 @@ jobs:
2727
# - https://gh.io/supported-runners-and-hardware-resources
2828
# - https://gh.io/using-larger-runners (GitHub.com only)
2929
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
30+
runs-on: ubuntu-latest
3131
permissions:
3232
# required for all workflows
3333
security-events: write
@@ -43,12 +43,14 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
include:
46-
- language: actions
47-
build-mode: none
48-
- language: csharp
49-
build-mode: none
50-
- language: swift
51-
build-mode: autobuild
46+
- language: actions
47+
build-mode: none
48+
- language: csharp
49+
build-mode: none
50+
# c-cpp and Swift analysis removed: Unity SDKs don't include build projects in the repo
51+
# (Unity generates Xcode/Android projects during build). CodeQL's C/C++ autobuilder
52+
# doesn't recognize .mm (Objective-C++) files as source files. The minimal native
53+
# bridge code is low-risk, and the main codebase (C#) is already being analyzed.
5254
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
5355
# Use `c-cpp` to analyze code written in C, C++ or both
5456
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
@@ -58,46 +60,47 @@ jobs:
5860
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
5961
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6062
steps:
61-
- name: Checkout repository
62-
uses: actions/checkout@v4
63+
- name: Checkout repository
64+
uses: actions/checkout@v6
6365

64-
# Add any setup steps before running the `github/codeql-action/init` action.
65-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
66-
# or others). This is typically only required for manual builds.
67-
# - name: Setup runtime (example)
68-
# uses: actions/setup-example@v1
66+
# Add any setup steps before running the `github/codeql-action/init` action.
67+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
68+
# or others). This is typically only required for manual builds.
69+
# - name: Setup runtime (example)
70+
# uses: actions/setup-example@v1
6971

70-
# Initializes the CodeQL tools for scanning.
71-
- name: Initialize CodeQL
72-
uses: github/codeql-action/init@v4
73-
with:
74-
languages: ${{ matrix.language }}
75-
build-mode: ${{ matrix.build-mode }}
76-
# If you wish to specify custom queries, you can do so here or in a config file.
77-
# By default, queries listed here will override any specified in a config file.
78-
# Prefix the list here with "+" to use these queries and those in the config file.
72+
# Initializes the CodeQL tools for scanning.
73+
- name: Initialize CodeQL
74+
uses: github/codeql-action/init@v4
75+
with:
76+
languages: ${{ matrix.language }}
77+
build-mode: ${{ matrix.build-mode }}
78+
# If you wish to specify custom queries, you can do so here or in a config file.
79+
# By default, queries listed here will override any specified in a config file.
80+
# Prefix the list here with "+" to use these queries and those in the config file.
7981

80-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
81-
# queries: security-extended,security-and-quality
82+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
83+
# Consider enabling security queries for better coverage:
84+
# queries: security-extended,security-and-quality
8285

83-
# If the analyze step fails for one of the languages you are analyzing with
84-
# "We were unable to automatically build your code", modify the matrix above
85-
# to set the build mode to "manual" for that language. Then modify this step
86-
# to build your code.
87-
# ℹ️ Command-line programs to run using the OS shell.
88-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
89-
- name: Run manual build steps
90-
if: matrix.build-mode == 'manual'
91-
shell: bash
92-
run: |
93-
echo 'If you are using a "manual" build mode for one or more of the' \
94-
'languages you are analyzing, replace this with the commands to build' \
95-
'your code, for example:'
96-
echo ' make bootstrap'
97-
echo ' make release'
98-
exit 1
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
99102
100-
- name: Perform CodeQL Analysis
101-
uses: github/codeql-action/analyze@v4
102-
with:
103-
category: "/language:${{matrix.language}}"
103+
- name: Perform CodeQL Analysis
104+
uses: github/codeql-action/analyze@v4
105+
with:
106+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)