Skip to content

Commit d9b56e4

Browse files
committed
feat #164: added codeql analysis file
Signed-off-by: sushant-suse <[email protected]>
1 parent 980bd8e commit d9b56e4

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
- '.github/workflows/codeql-analysis.yml'
10+
pull_request:
11+
branches: [ "main" ]
12+
paths:
13+
- 'src/**'
14+
- 'tests/**'
15+
- '.github/workflows/codeql-analysis.yml'
16+
schedule:
17+
- cron: '30 18 * * 1' # Runs every Monday at 18:30 UTC
18+
19+
# Centralize the Python version here for easy updates
20+
env:
21+
PYTHON_VERSION: '3.12'
22+
23+
permissions:
24+
contents: read
25+
security-events: write
26+
actions: read
27+
28+
jobs:
29+
analyze:
30+
name: Analyze
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 36
33+
permissions:
34+
actions: read
35+
contents: read
36+
security-events: write
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
language: [ 'python' ]
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v6
46+
47+
- name: Set up Python ${{ env.PYTHON_VERSION }}
48+
uses: actions/setup-python@v6
49+
with:
50+
python-version: ${{ env.PYTHON_VERSION }}
51+
52+
- name: Setup uv
53+
uses: astral-sh/setup-uv@v7
54+
with:
55+
enable-cache: true
56+
cache-dependency-glob: "uv.lock"
57+
58+
- name: Install dependencies
59+
run: uv sync --frozen --group github-action
60+
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
# Extended suites catch more complex vulnerabilities and code quality smells
66+
queries: security-extended,security-and-quality
67+
68+
- name: Perform Analysis
69+
uses: github/codeql-action/analyze@v3
70+
with:
71+
category: "/language:${{matrix.language}}"

changelog.d/164.infra.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Integrated GitHub CodeQL analysis for automated security scanning of Python source code.

0 commit comments

Comments
 (0)