Skip to content

Upgrade python Workflows #3

Upgrade python Workflows

Upgrade python Workflows #3

Workflow file for this run

name: "CodeQL code Scan"

Check failure on line 1 in .github/workflows/Codeql.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/Codeql.yml

Invalid workflow file

(Line: 25, Col: 22): A sequence was not expected
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
codeql:
name: "CodeQL Analysis"
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
# 1️⃣ Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# 2️⃣ Initialize CodeQL
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ["python","javascript"] # Add more languages if needed
# 3️⃣ Auto-build the project for CodeQL
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# 4️⃣ Perform CodeQL analysis and generate SARIF report
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
output: results.sarif
upload-sarif: true # Upload to GitHub Security tab
# 5️⃣ Comment Top-N alerts per file + PR summary + file severity overview + overflow notice
- name: Comment CodeQL Alerts with Top-N and File Severity Overview
uses: marocchino/sticky-pull-request-comment@v2
with:
path: results.sarif
header: "### :shield: CodeQL Security Alerts Summary"
layout: "group-by-file"
format: "markdown-table"
sort-severity: true # Sort alerts: Critical → High → Medium → Low
highlight: "Critical,High" # Highlight most severe alerts
collapse: "Medium,Low" # Collapse medium/low severity alerts
max-items-per-file: 5 # Display top 5 alerts per file
show-summary: true # Show total alert summary table for the PR
show-file-overview: true # Show file-level Critical/High counts
overflow-text: "+{remaining} more alerts in this file" # Folded notice for extra alerts
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}