Skip to content

Commit e46eded

Browse files
Feat: Implementing Codeql for Security Code Scanning (#2)
* Create CodeQL analysis workflow * Create CodeQL config file
1 parent 3bddb2c commit e46eded

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Configuration file for CodeQL.
2+
# You can tune the CodeQL analysis (excluding paths from being scanned for instance)
3+
#
4+
# See https://codeql.github.com/docs/codeql-cli/specifying-command-options-in-a-codeql-configuration-file/
5+
6+
paths-ignore:
7+
- "**/*__tests__*/**"
8+
- "*vendor"
9+
- "**/vendor*/**"
10+
- "docs/*"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "CodeQL - Default"
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ '**' ]
9+
schedule:
10+
- cron: '2 6 * * 4'
11+
workflow_dispatch:
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: lever-self-hosted
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: ['javascript']
26+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
- name: Install nodejs
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '>=20'
35+
# Initializes the CodeQL tools for scanning.
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
config-file: ./.github/codeql/codeql-config-default.yml
41+
# 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
42+
queries: security-extended,security-and-quality
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@v3
46+
with:
47+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)