-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (54 loc) · 1.96 KB
/
Copy pathcodeql-analysis.yml
File metadata and controls
63 lines (54 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# CodeQL code scanning workflow — updated to current recommended actions
# - uses checkout@v4 and codeql-action/init/autobuild/analyze v3
# - adds workflow_dispatch, concurrency, and an optional dependency-install step
name: "Code scanning - CodeQL"
on:
push:
branches: [ "main" ]
paths-ignore: [ "README.md" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '38 7 * * 1'
workflow_dispatch:
jobs:
analyze:
name: Analyze (CodeQL)
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# Supported languages: [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Optional: install dependencies so CodeQL can pick up types / compiled artifacts.
- name: Install dependencies (if present)
run: |
if [ -f package-lock.json ] || [ -f yarn.lock ] || [ -f package.json ]; then
echo "Installing node dependencies (if any)..."
npm ci || npm install || true
else
echo "No Node dependency files found; skipping install."
fi
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you want custom query packs, uncomment and adjust:
# queries: +security-extended,security-and-quality
# config-file: .github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
# If you use a custom config file or want to upload SARIF to an external system,
# add with: config-file: .github/codeql/codeql-config.yml