Skip to content

Commit e5e3455

Browse files
committed
Adding codeql scanning and configuring workflows
1 parent 587bc32 commit e5e3455

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

.github/codeql/codeql-config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Custom CodeQL Config"
2+
3+
# Specify which queries to run
4+
queries:
5+
- uses: security-extended
6+
- uses: security-and-quality
7+
8+
# Paths to exclude from analysis
9+
paths-ignore:
10+
- node_modules
11+
- dist
12+
- build
13+
- coverage
14+
- '**/test_*.py'
15+
16+
17+
# Paths to include in analysis
18+
paths:
19+
- src

.github/workflows/codeql.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# .github/workflows/codeql.yml
2+
name: "CodeQL"
3+
4+
on:
5+
workflow_dispatch: {}
6+
push:
7+
branches: [ "main", "develop" ]
8+
pull_request:
9+
branches: [ "develop" ]
10+
types: [opened, synchronize, reopened]
11+
# schedule:
12+
# # Run at 2:30 AM UTC every day
13+
# - cron: '30 2 * * *'
14+
15+
jobs:
16+
analyze:
17+
name: Analyze
18+
runs-on: ubuntu-latest
19+
permissions:
20+
actions: read
21+
contents: read
22+
security-events: write
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: [ 'javascript' ]
28+
# CodeQL supports: 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'
29+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v4
37+
with:
38+
languages: ${{ matrix.language }}
39+
config-file: ./.github/codeql/codeql-config.yml
40+
# If you wish to specify custom queries, you can do so here or in a config file.
41+
# By default, queries listed here will override any specified in a config file.
42+
# Prefix the list here with "+" to use these queries and those in the config file.
43+
44+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
45+
# queries: security-extended,security-and-quality
46+
47+
- name: Perform CodeQL Analysis
48+
uses: github/codeql-action/analyze@v4
49+
with:
50+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)