Skip to content

Commit f535e35

Browse files
authored
CodeQL: switch to advanced setup (#807)
- Using a codeql.yml rather than the default setup - keep the weekly analysis only - ignore sql/
2 parents 27cbf7f + 7db5446 commit f535e35

File tree

2 files changed

+96
-9
lines changed

2 files changed

+96
-9
lines changed

.github/workflows/codeql.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
# push:
5+
# branches: [ "main" ]
6+
# pull_request:
7+
# branches: [ "main" ]
8+
schedule:
9+
- cron: '39 18 * * 0'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
# Runner size impacts CodeQL analysis time. To learn more, please see:
15+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
16+
# - https://gh.io/supported-runners-and-hardware-resources
17+
# - https://gh.io/using-larger-runners (GitHub.com only)
18+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
19+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
20+
permissions:
21+
# required for all workflows
22+
security-events: write
23+
24+
# required to fetch internal or private CodeQL packs
25+
packages: read
26+
27+
# only required for workflows in private repositories
28+
actions: read
29+
contents: read
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
# C/C++/Java/Kotlin disabled because CodeQL doesn't know how to autobuild them
36+
# - language: c-cpp
37+
# build-mode: autobuild
38+
# - language: java-kotlin
39+
# build-mode: autobuild
40+
- language: javascript-typescript
41+
build-mode: none
42+
- language: python
43+
build-mode: none
44+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
45+
# Use `c-cpp` to analyze code written in C, C++ or both
46+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
47+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
48+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
49+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
50+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
51+
# 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
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
# Add any setup steps before running the `github/codeql-action/init` action.
57+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
58+
# or others). This is typically only required for manual builds.
59+
# - name: Setup runtime (example)
60+
# uses: actions/setup-example@v1
61+
62+
# Initializes the CodeQL tools for scanning.
63+
- name: Initialize CodeQL
64+
uses: github/codeql-action/init@v3
65+
with:
66+
languages: ${{ matrix.language }}
67+
build-mode: ${{ matrix.build-mode }}
68+
# If you wish to specify custom queries, you can do so here or in a config file.
69+
# By default, queries listed here will override any specified in a config file.
70+
# Prefix the list here with "+" to use these queries and those in the config file.
71+
72+
# 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
73+
# queries: security-extended,security-and-quality
74+
75+
# If the analyze step fails for one of the languages you are analyzing with
76+
# "We were unable to automatically build your code", modify the matrix above
77+
# to set the build mode to "manual" for that language. Then modify this step
78+
# to build your code.
79+
# ℹ️ Command-line programs to run using the OS shell.
80+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
81+
- if: matrix.build-mode == 'manual'
82+
shell: bash
83+
run: |
84+
echo 'If you are using a "manual" build mode for one or more of the' \
85+
'languages you are analyzing, replace this with the commands to build' \
86+
'your code, for example:'
87+
echo ' make bootstrap'
88+
echo ' make release'
89+
exit 1
90+
91+
- name: Perform CodeQL Analysis
92+
uses: github/codeql-action/analyze@v3
93+
with:
94+
category: "/language:${{matrix.language}}"
95+
paths-ignore: |
96+
sql/**

codeql-config.yml

-9
This file was deleted.

0 commit comments

Comments
 (0)