Repository navigation
58 lines (51 loc) · 2.39 KB
/
Copy pathcodeql.yml
File metadata and controls
58 lines (51 loc) · 2.39 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
# CodeQL Analysis Configuration
# Scans for security vulnerabilities in TypeScript/JavaScript code.
#
# **This is the repository's only CodeQL analysis, and the only `init` call in any workflow.** A second one used to run
# in `security-audit.yml` under the same category (`/language:javascript-typescript`), so the two replaced each other's
# results on every push; the copy without the triage file is the one that ended up on the Security tab, which is why
# shapes the triage file had already answered came back the next day. `tests/unit/scripts/codeql-triage-is-scoped-and-named.test.ts`
# holds the count at one.
name: 'CodeQL'
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '0 6 * * 1' # Every Monday at 06:00 UTC
# **Least privilege, granted where it is used.** `security-events: write` and `actions: read` are what the analysis job
# needs in order to upload results and to read the previous run's baseline; no other job in this file exists. The
# workflow-level grant is `contents: read` only, so a future job added here does not inherit the ability to overwrite
# alerts until someone writes that permission into it.
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
language: ['javascript-typescript']
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Initialize CodeQL
uses: github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9 # v3
with:
languages: ${{ matrix.language }}
# **The suite and the triage both live in one file**, `.github/codeql/codeql-config.yml`: the queries it names
# and the `(query, path)` pairs where the query's premise does not hold. Keeping them here would mean a
# suppression could be added without a reason next to it.
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@9418214df1f2c4b8128c770156c409013b07d6b9 # v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9 # v3
with:
category: '/language:${{matrix.language}}'