Skip to content

Commit ae91912

Browse files
committed
ci(codeql): switch to advanced configuration
1 parent 1d96bc4 commit ae91912

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: "CodeQL"
3+
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
- cron: "0 0 * * 0"
9+
workflow_dispatch:
10+
11+
permissions: {}
12+
13+
jobs:
14+
analyze:
15+
name: Analyze (${{ matrix.language }})
16+
# Runner size impacts CodeQL analysis time. To learn more, please see:
17+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
18+
# - https://gh.io/supported-runners-and-hardware-resources
19+
# - https://gh.io/using-larger-runners (github.com only)
20+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
21+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
22+
permissions:
23+
# required for all workflows
24+
security-events: write
25+
26+
# required to fetch internal or private CodeQL packs
27+
packages: read
28+
29+
# only required for workflows in private repositories
30+
actions: read
31+
contents: read
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
include:
37+
- language: actions
38+
build-mode: none
39+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
40+
# Use `c-cpp` to analyze code written in C, C++ or both
41+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
42+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
43+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
44+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
45+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
46+
# 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
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
51+
# Add any setup steps before running the `github/codeql-action/init` action.
52+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
53+
# or others). This is typically only required for manual builds.
54+
# - name: Setup runtime (example)
55+
# uses: actions/setup-example@v1
56+
57+
# Initializes the CodeQL tools for scanning.
58+
- name: Initialize CodeQL
59+
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
60+
with:
61+
languages: ${{ matrix.language }}
62+
build-mode: ${{ matrix.build-mode }}
63+
# If you wish to specify custom queries, you can do so here or in a config file.
64+
# By default, queries listed here will override any specified in a config file.
65+
# Prefix the list here with "+" to use these queries and those in the config file.
66+
67+
# 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
68+
# queries: security-extended,security-and-quality
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
72+
with:
73+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)