-
-
Notifications
You must be signed in to change notification settings - Fork 13
70 lines (61 loc) · 2.49 KB
/
Copy pathcodeql.yml
File metadata and controls
70 lines (61 loc) · 2.49 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
name: CodeQL
# Static analysis for the classes of bug that reading does not reliably catch:
# injection, unsafe deserialisation, path traversal, prototype pollution.
#
# Added when this repository was prepared for publication. The pre-publication
# audit found seven routes reachable with no credential and three signing
# secrets that fell back to string literals, all by hand. This is the standing
# version of that: it runs on every push and every pull request, so the next one
# is caught by a machine rather than by someone happening to look.
#
# The weekly run matters as much as the per-push one. CodeQL's queries improve
# over time, so code that was clean when it merged can be reported later without
# anything in it having changed.
on:
push:
branches: [main]
pull_request:
branches: [main, develop]
schedule:
# Mondays, early. Far enough from a working day that a red result is seen
# before anyone starts building on top of it.
- cron: "17 5 * * 1"
permissions:
contents: read
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyse:
name: Analyse JavaScript
runs-on: ubuntu-latest
timeout-minutes: 30
# Code scanning is free on a public repository and a paid GitHub Advanced
# Security feature on a private one. While this repository is still private
# the analysis runs to completion and then fails on the upload with
# "Advanced Security must be enabled for this repository" - a red tick that
# says nothing about the code.
#
# So it skips while private and starts running by itself the moment the
# repository is published. Nothing to remember to turn on, which matters
# because publication day is exactly when the results are wanted.
if: github.event.repository.private == false
permissions:
# Writing the results to the Security tab is the whole point.
security-events: write
contents: read
actions: read
steps:
- uses: actions/checkout@v7
- name: Initialise CodeQL
uses: github/codeql-action/init@v4
with:
languages: javascript-typescript
# security-extended adds queries with a higher false-positive rate.
# Worth it here: this handles money and runs a database on a shop's
# counter, and a false positive costs a few minutes of reading.
queries: security-extended
- name: Analyse
uses: github/codeql-action/analyze@v4
with:
category: /language:javascript-typescript