Skip to content

Commit 4b57564

Browse files
Initial CodeQL commit
1 parent 8e8374d commit 4b57564

File tree

1 file changed

+195
-0
lines changed

1 file changed

+195
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
branches: [ "master" ]
19+
20+
jobs:
21+
analyze:
22+
name: Analyze (${{ matrix.language }})
23+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
24+
permissions:
25+
# required for all workflows
26+
security-events: write
27+
28+
# required to fetch internal or private CodeQL packs
29+
packages: read
30+
31+
# only required for workflows in private repositories
32+
actions: read
33+
contents: read
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
include:
39+
- language: actions
40+
build-mode: none
41+
- language: javascript-typescript
42+
build-mode: none
43+
- language: ruby
44+
build-mode: none
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
48+
49+
# Add any setup steps before running the `github/codeql-action/init` action.
50+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
51+
# or others). This is typically only required for manual builds.
52+
# - name: Setup runtime (example)
53+
# uses: actions/setup-example@v1
54+
55+
# Initializes the CodeQL tools for scanning.
56+
- name: Initialize CodeQL
57+
uses: github/codeql-action/init@v3
58+
with:
59+
languages: ${{ matrix.language }}
60+
build-mode: ${{ matrix.build-mode }}
61+
# If you wish to specify custom queries, you can do so here or in a config file.
62+
# By default, queries listed here will override any specified in a config file.
63+
# Prefix the list here with "+" to use these queries and those in the config file.
64+
65+
# 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
66+
queries: ${{ matrix.language && 'security-extended, security-and-quality' }}
67+
68+
- if: matrix.build-mode == 'manual'
69+
shell: bash
70+
run: |
71+
echo 'If you are using a "manual" build mode for one or more of the' \
72+
'languages you are analyzing, replace this with the commands to build' \
73+
'your code, for example:'
74+
echo ' make bootstrap'
75+
echo ' make release'
76+
exit 1
77+
- name: Perform CodeQL Analysis
78+
uses: github/codeql-action/analyze@v3
79+
with:
80+
category: "/language:${{matrix.language}}"
81+
82+
analyze2:
83+
name: Analyze (${{ matrix.language }})
84+
runs-on: ubuntu-latest
85+
permissions:
86+
# required for all workflows
87+
security-events: write
88+
89+
# required to fetch internal or private CodeQL packs
90+
packages: read
91+
92+
# only required for workflows in private repositories
93+
actions: read
94+
contents: read
95+
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
include:
100+
- language: java-kotlin
101+
build-mode: none
102+
steps:
103+
- name: Checkout repository
104+
uses: actions/checkout@v4
105+
106+
# Add any setup steps before running the `github/codeql-action/init` action.
107+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
108+
# or others). This is typically only required for manual builds.
109+
# - name: Setup runtime (example)
110+
# uses: actions/setup-example@v1
111+
112+
# Initializes the CodeQL tools for scanning.
113+
- name: Initialize CodeQL
114+
uses: github/codeql-action/init@v3
115+
with:
116+
languages: ${{ matrix.language }}
117+
build-mode: ${{ matrix.build-mode }}
118+
# If you wish to specify custom queries, you can do so here or in a config file.
119+
# By default, queries listed here will override any specified in a config file.
120+
# Prefix the list here with "+" to use these queries and those in the config file.
121+
122+
# 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
123+
queries: ${{ matrix.language && 'security-extended, security-and-quality' }}
124+
125+
- if: matrix.build-mode == 'manual'
126+
shell: bash
127+
run: |
128+
echo 'If you are using a "manual" build mode for one or more of the' \
129+
'languages you are analyzing, replace this with the commands to build' \
130+
'your code, for example:'
131+
echo ' make bootstrap'
132+
echo ' make release'
133+
exit 1
134+
- name: Perform CodeQL Analysis
135+
uses: github/codeql-action/analyze@v3
136+
with:
137+
category: "/language:${{matrix.language}}"
138+
139+
140+
analyze3:
141+
name: Analyze (${{ matrix.language }})
142+
runs-on: ${{ (matrix.language == 'swift' && 'macos-15') || 'ubuntu-latest' }}
143+
permissions:
144+
# required for all workflows
145+
security-events: write
146+
147+
# required to fetch internal or private CodeQL packs
148+
packages: read
149+
150+
# only required for workflows in private repositories
151+
actions: read
152+
contents: read
153+
154+
strategy:
155+
fail-fast: false
156+
matrix:
157+
include:
158+
- language: swift
159+
build-mode: none
160+
steps:
161+
- name: Checkout repository
162+
uses: actions/checkout@v4
163+
164+
# Add any setup steps before running the `github/codeql-action/init` action.
165+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
166+
# or others). This is typically only required for manual builds.
167+
# - name: Setup runtime (example)
168+
# uses: actions/setup-example@v1
169+
170+
# Initializes the CodeQL tools for scanning.
171+
- name: Initialize CodeQL
172+
uses: github/codeql-action/init@v3
173+
with:
174+
languages: ${{ matrix.language }}
175+
build-mode: ${{ matrix.build-mode }}
176+
# If you wish to specify custom queries, you can do so here or in a config file.
177+
# By default, queries listed here will override any specified in a config file.
178+
# Prefix the list here with "+" to use these queries and those in the config file.
179+
180+
# 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
181+
queries: ${{ matrix.language && 'security-extended, security-and-quality' }}
182+
183+
- if: matrix.build-mode == 'manual'
184+
shell: bash
185+
run: |
186+
echo 'If you are using a "manual" build mode for one or more of the' \
187+
'languages you are analyzing, replace this with the commands to build' \
188+
'your code, for example:'
189+
echo ' make bootstrap'
190+
echo ' make release'
191+
exit 1
192+
- name: Perform CodeQL Analysis
193+
uses: github/codeql-action/analyze@v3
194+
with:
195+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)