Skip to content

Upgrade python Workflows #4

Upgrade python Workflows

Upgrade python Workflows #4

Workflow file for this run

name: "CodeQL Security 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: 36, Col: 22): A sequence was not expected
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main, master]
permissions:
security-events: write
actions: read
contents: read
jobs:
codeql:
name: "CodeQL Analysis"
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
# 1️⃣ Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
with:
# 必须深度检出以获取完整历史记录进行精确分析
fetch-depth: 0
# 2️⃣ Initialize CodeQL
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ["python","javascript"]
# 如果是私有仓库或需要认证的依赖,配置这里
# config-file: ./.github/codeql/codeql-config.yml
# 3️⃣ Auto-build the project for CodeQL
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# 4️⃣ Perform CodeQL analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:python_and_javascript"
# 上传结果到GitHub安全选项卡
upload: true
# 5️⃣ 可选:添加PR注释(仅当不是fork PR时)
- name: Comment PR with CodeQL results
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: github/codeql-action/comment@v3
with:
moniker: codeql-analysis