Skip to content

Commit c7db2c2

Browse files
authored
PYTHON-4384 [v4.7] Add Custom CodeQL Scanning (#1655)
1 parent 358a486 commit c7db2c2

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

Diff for: .github/workflows/codeql.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master", "v*"]
6+
tags: ['*']
7+
pull_request:
8+
schedule:
9+
- cron: '17 10 * * 2'
10+
11+
concurrency:
12+
group: codeql-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
analyze:
17+
name: Analyze (${{ matrix.language }})
18+
runs-on: "ubuntu-latest"
19+
timeout-minutes: 360
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+
strategy:
28+
fail-fast: false
29+
matrix:
30+
include:
31+
- language: c-cpp
32+
build-mode: manual
33+
- language: python
34+
build-mode: none
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
- uses: actions/setup-python@v3
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v3
43+
with:
44+
languages: ${{ matrix.language }}
45+
build-mode: ${{ matrix.build-mode }}
46+
# 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
47+
queries: security-extended
48+
config: |
49+
paths-ignore:
50+
- '.github/**'
51+
- 'doc/**'
52+
- 'tools/**'
53+
- 'test/**'
54+
55+
- if: matrix.build-mode == 'manual'
56+
run: |
57+
pip install -e .
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v3
61+
with:
62+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)