-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.5 KB
/
Copy pathcodeql-quality.yml
File metadata and controls
73 lines (64 loc) · 2.5 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
70
71
72
73
name: codeql-quality
# Opt-in CodeQL *quality* scan — the three rules defined in
# codeql/prx-quality.qls (the same suite the local `nix run .#codeql-quality`
# uses): js/unused-local-variable, js/useless-assignment-to-local,
# js/trivial-conditional.
#
# This is deliberately separate from the security CodeQL default-setup scan and
# never gates PRs: it runs only on manual dispatch + a weekly schedule. SARIF
# upload to code scanning is gated off (like osv-scanner.yml / scorecard.yml) —
# results are kept as an artifact — because default setup already owns the
# code-scanning SARIF channel and a second uploader can conflict. Flip
# `upload: never` → `upload: always` once you want quality findings in the
# Security tab.
on:
workflow_dispatch:
schedule:
- cron: "37 7 * * 1"
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-latest
permissions:
security-events: write # SARIF upload to code scanning (gated below)
contents: read
steps:
- name: Harden runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Node.js
# CodeQL's TypeScript extractor requires Node.js on PATH.
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
with:
languages: javascript-typescript
build-mode: none
# Run ONLY our three quality rules, not the default suite.
config: |
disable-default-queries: true
queries:
- uses: ./codeql/prx-quality.qls
- name: Analyze
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
with:
category: "/quality:prx"
# Artifact-only for now (see header). `output` writes the SARIF files
# that the next step archives.
upload: never
output: codeql-quality-results
- name: Upload artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: codeql-quality-results
path: codeql-quality-results
retention-days: 5