Skip to content

Commit 96613b3

Browse files
committed
INTPYTHON-607 Add CodeQL Scanning
1 parent 3214d2f commit 96613b3

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/codeql.yml

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

0 commit comments

Comments
 (0)