Skip to content

Commit e42c6e8

Browse files
authored
Upgrade Codeql.yml
1 parent 841f853 commit e42c6e8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/Codeql.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
name: "CodeQL Python Security Scan"
1+
name: "CodeQL Python Security and Quality Scan"
22

33
on:
4-
pull_request:
5-
branches: [ main, master ]
6-
types: [opened, synchronize, reopened]
74
push:
85
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
98

109
permissions:
1110
contents: read
@@ -18,21 +17,26 @@ jobs:
1817
runs-on: ubuntu-latest
1918

2019
steps:
20+
# 1. 检出代码
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 0
2525

26+
# 2. 初始化 CodeQL
2627
- name: Initialize CodeQL
2728
uses: github/codeql-action/init@v3
2829
with:
2930
languages: python
30-
queries: +security-extended,+security-and-quality
31+
# 不指定 queries,Action 会默认跑安全 + 质量查询
3132

33+
# 3. 自动构建
3234
- name: Autobuild
3335
uses: github/codeql-action/autobuild@v3
3436

37+
# 4. 执行分析
3538
- name: Perform CodeQL Analysis
3639
uses: github/codeql-action/analyze@v3
3740
with:
41+
# 不指定 queries,Action 会自动跑安全 + 质量规则
3842
upload: true

0 commit comments

Comments
 (0)