File tree Expand file tree Collapse file tree 2 files changed +67
-5
lines changed Expand file tree Collapse file tree 2 files changed +67
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : " CodeQL Python Security Scan (Top-N + PR Comment)"
2
+
3
+ on :
4
+ pull_request :
5
+ branches : [ main, master ]
6
+ types : [opened, synchronize, reopened]
7
+ push :
8
+ branches : [ main, master ]
9
+
10
+ permissions :
11
+ contents : read
12
+ actions : read
13
+ security-events : write
14
+
15
+ jobs :
16
+ codeql-analysis :
17
+ name : " CodeQL Analysis (Python)"
18
+ runs-on : ubuntu-latest
19
+
20
+ steps :
21
+ - name : Checkout repository
22
+ uses : actions/checkout@v4
23
+ with :
24
+ fetch-depth : 0
25
+
26
+ - name : Initialize CodeQL
27
+ uses : github/codeql-action/init@v3
28
+ with :
29
+ languages : python
30
+
31
+ - name : Autobuild
32
+ uses : github/codeql-action/autobuild@v3
33
+
34
+ - name : Perform CodeQL Analysis
35
+ uses : github/codeql-action/analyze@v3
36
+ with :
37
+ upload : true
38
+
39
+ - name : Comment CodeQL Alerts on PR
40
+ if : github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
41
+ uses : marocchino/sticky-pull-request-comment@v2
42
+ with :
43
+ path : results.sarif
44
+ header : " ### :shield: CodeQL Python Security Alerts Summary"
45
+ layout : " group-by-file"
46
+ format : " markdown-table"
47
+ sort-severity : true
48
+ highlight : " Critical,High"
49
+ collapse : " Medium,Low"
50
+ max-items-per-file : 5
51
+ show-summary : true
52
+ show-file-overview : true
53
+ overflow-text : " +{remaining} more alerts in this file"
54
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
1
name : Python Checks
2
2
3
- on : [pull_request, push]
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened]
6
+ push :
7
+ branches :
8
+ - main
9
+
10
+ concurrency :
11
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12
+ cancel-in-progress : true
4
13
5
14
jobs :
6
15
Test :
7
16
runs-on : ubuntu-latest
8
17
steps :
9
18
- name : Checkout repository
10
- uses : actions/checkout@v2
19
+ uses : actions/checkout@v4
11
20
12
21
- name : Set up Python
13
- uses : actions/setup-python@v2
22
+ uses : actions/setup-python@v5
14
23
with :
15
24
python-version : ' 3.13'
16
25
17
26
- name : Cache Python dependencies
18
- id : cache-pip
19
27
uses : actions/cache@v3
20
28
with :
21
29
path : ~/.cache/pip
42
50
run : mypy . --ignore-missing-imports || true
43
51
44
52
- name : Run Pytest tests
45
- run : pytest
53
+ run : pytest
You can’t perform that action at this time.
0 commit comments