Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/Codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "CodeQL Python Security Scan (Top-N + PR Comment)"

on:
pull_request:
branches: [ main, master ]
types: [opened, synchronize, reopened]
push:
branches: [ main, master ]

permissions:
contents: read
actions: read
security-events: write

jobs:
codeql-analysis:
name: "CodeQL Analysis (Python)"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
upload: true

- name: Comment CodeQL Alerts on PR
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: marocchino/sticky-pull-request-comment@v2
with:
path: results.sarif
header: "### :shield: CodeQL Python Security Alerts Summary"
layout: "group-by-file"
format: "markdown-table"
sort-severity: true
highlight: "Critical,High"
collapse: "Medium,Low"
max-items-per-file: 5
show-summary: true
show-file-overview: true
overflow-text: "+{remaining} more alerts in this file"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 13 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
name: Python Checks

on: [pull_request, push]
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Cache Python dependencies
id: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
Expand All @@ -42,4 +50,4 @@ jobs:
run: mypy . --ignore-missing-imports || true

- name: Run Pytest tests
run: pytest
run: pytest
Loading