Skip to content

Commit 18152a7

Browse files
authored
1 parent 5902dd1 commit 18152a7

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
# Commented for now to test
7+
# pull_request:
8+
# branches: [ "main" ]
9+
# schedule:
10+
# - cron: '22 14 * * 4'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze (${{ matrix.language }})
15+
# Runner size impacts CodeQL analysis time. To learn more, please see:
16+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
17+
# - https://gh.io/supported-runners-and-hardware-resources
18+
# - https://gh.io/using-larger-runners (GitHub.com only)
19+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
20+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
21+
permissions:
22+
# required for all workflows
23+
security-events: write
24+
25+
# required to fetch internal or private CodeQL packs
26+
packages: read
27+
28+
# only required for workflows in private repositories
29+
actions: read
30+
contents: read
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- language: actions
37+
build-mode: none
38+
- language: rust
39+
build-mode: none
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v3
47+
with:
48+
languages: ${{ matrix.language }}
49+
build-mode: ${{ matrix.build-mode }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# 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
55+
# queries: security-extended,security-and-quality
56+
57+
# If the analyze step fails for one of the languages you are analyzing with
58+
# "We were unable to automatically build your code", modify the matrix above
59+
# to set the build mode to "manual" for that language. Then modify this step
60+
# to build your code.
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
- if: matrix.build-mode == 'manual'
64+
shell: bash
65+
run: |
66+
echo 'If you are using a "manual" build mode for one or more of the' \
67+
'languages you are analyzing, replace this with the commands to build' \
68+
'your code, for example:'
69+
echo ' make bootstrap'
70+
echo ' make release'
71+
exit 1
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v3
75+
with:
76+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)