Skip to content

Commit fb381a8

Browse files
Add CodeQL workflow for GitHub code scanning (#51)
Co-authored-by: LGTM Migrator <[email protected]>
1 parent 92c71e3 commit fb381a8

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/codeql.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
query-filters:
2+
- exclude:
3+
id: py/similar-function
4+
- exclude:
5+
id: py/empty-except
6+
- exclude:
7+
id: py/call-to-non-callable
8+
- include:
9+
id: py/undefined-placeholder-variable
10+
- include:
11+
id: py/uninitialized-local-variable
12+
- include:
13+
id: py/request-without-cert-validation
14+
- include:
15+
id: py/return-or-yield-outside-function
16+
- include:
17+
id: py/file-not-closed
18+
- include:
19+
id: py/exit-from-finally
20+
- include:
21+
id: py/ineffectual-statement
22+
- include:
23+
id: py/unused-global-variable
24+
- include:
25+
id: py/hardcoded-credentials
26+
- include:
27+
id: py/import-of-mutable-attribute
28+
- include:
29+
id: py/cyclic-import
30+
- include:
31+
id: py/unnecessary-lambda
32+
- include:
33+
id: py/print-during-import

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: "26 5 * * 0"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ python ]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
config-file: ./.github/codeql.yml
34+
queries: +security-and-quality
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v2
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v2
41+
with:
42+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)