Repository navigation
69 lines (59 loc) · 2.28 KB
/
Copy pathcodeql.yml
File metadata and controls
69 lines (59 loc) · 2.28 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
64
65
66
67
68
69
# CodeQL semantic security analysis.
#
# Catches the class of issue our test suite + ESLint + `pnpm audit` don't:
# semantic injection sinks, prototype pollution, taint-propagation flaws,
# and TypeScript-specific patterns CodeQL's javascript-typescript query
# pack has built-in checks for. Findings appear under the repo's
# Security tab → Code scanning, and inline on PRs.
#
# Free for public repos.
# Reference: https://github.com/github/codeql-action
name: CodeQL
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
# Weekly scan in case a new query/CVE pattern surfaces against
# already-merged code. Tuesday 04:17 UTC is off-peak and out of the
# main work hours so the run doesn't compete with CI.
- cron: '17 4 * * 2'
permissions:
contents: read
security-events: write
actions: read
jobs:
analyze:
name: Analyze (javascript-typescript)
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
language: ['javascript-typescript']
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
languages: ${{ matrix.language }}
# Run the extended security-and-quality query pack — more checks
# than the default "security" pack, accepts some noise to catch
# more.
queries: security-and-quality
# No manual build step needed for JS/TS — CodeQL's autobuild handles
# tsc compilation. Skipping `pnpm install` keeps the analysis from
# scanning node_modules for findings against dependencies.
- name: Autobuild
uses: github/codeql-action/autobuild@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
category: '/language:${{ matrix.language }}'