Skip to content

Commit 2c1b7a6

Browse files
authored
Merge pull request #10 from Chinyemba-ck/add-codeql
Add CodeQL workflow for SAST
2 parents 33f8ff5 + d66924f commit 2c1b7a6

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CodeQL static analysis for SAST (Static Application Security Testing).
2+
3+
name: "CodeQL"
4+
5+
on:
6+
# Scan every commit pushed to main.
7+
push:
8+
branches: [ "main" ]
9+
# Scan pull requests before merging to catch vulnerabilities early.
10+
pull_request:
11+
# The branches below must be a subset of the branches above.
12+
branches: [ "main" ]
13+
# Weekly scan every Monday at 03:25 UTC.
14+
schedule:
15+
- cron: '25 3 * * 1'
16+
17+
# Declare default permissions as read only (principle of least privilege).
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
analyze:
23+
name: Analyze (${{ matrix.language }})
24+
runs-on: ubuntu-latest
25+
permissions:
26+
actions: read # for github/codeql-action/init to get workflow details
27+
contents: read # for actions/checkout to fetch code
28+
security-events: write # for github/codeql-action/analyze to upload results
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
language: [ 'python', 'javascript' ]
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
37+
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v4.32.2
40+
with:
41+
languages: ${{ matrix.language }}
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v4.32.2
45+
with:
46+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)