Repository navigation
73 lines (69 loc) · 2.83 KB
/
Copy pathcodeql.yml
File metadata and controls
73 lines (69 loc) · 2.83 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
# CodeQL static security analysis ([GITHUB-CODE-SCANNING]).
#
# SEPARATE from ci.yml on purpose: CodeQL feeds GitHub code-scanning alerts and
# needs `security-events: write` + a weekly schedule, while ci.yml owns
# lint/test/build. It does NOT overlap with `make lint` (style/correctness) or
# dependency-review (vulnerable packages) — CodeQL finds vulnerable CODE. Never
# add security-rule linter plugins that re-cover CodeQL: no doubling up.
#
# Matrix = lspkit's languages that CodeQL supports (Rust, TypeScript, C#) plus
# `actions`, which scans the workflow files themselves. F# has no CodeQL
# support. Action SHAs are kept current by the github-actions Dependabot group
# ([GITHUB-DEPENDABOT]).
on:
pull_request:
branches: [main]
schedule:
# Weekly, so newly-published CodeQL queries re-scan even without a push.
- cron: "27 4 * * 1"
permissions:
contents: read
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 20
# Code scanning (SARIF upload) requires GitHub Advanced Security on PRIVATE
# repos. Gating on public visibility lets a private repo skip cleanly (no red
# X) and self-enable the moment it is made public — no follow-up edit needed.
# Dependabot PRs are excluded: they are swept into `dependabot-upgrades` by
# dependabot-automerge.yml and never merge to main directly, so scanning them
# only burns the matrix on a bump we discard — CodeQL runs on the
# consolidation PR instead. ([GITHUB-DEPENDABOT])
if: github.event.repository.visibility == 'public' && github.actor != 'dependabot[bot]'
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
# `build-mode: none` analyses Rust, TypeScript and C# without
# re-compiling what ci.yml already builds.
include:
- language: actions # scans the workflow files themselves
build-mode: none
- language: rust
build-mode: none
- language: javascript-typescript
build-mode: none
- language: csharp
build-mode: none
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: "/language:${{ matrix.language }}"