Repository navigation
53 lines (50 loc) · 2.27 KB
/
Copy pathcodeql.yml
File metadata and controls
53 lines (50 loc) · 2.27 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
name: CodeQL
# CodeQL's code scanning of the workflows, the TypeScript and the Rust, with the paths in
# .github/codeql/codeql-config.yml left out (the Rust tests). Default setup ran the same languages
# and suite but can't take a config file. Each language uploads under the category default setup
# used, so its alerts carry over.
#
# ci.yml calls it for every pull request into main, merge queue group and push to main but a
# draft's, with the languages whose code changed. The "Protect Main" ruleset's code scanning rule
# waits for an analysis of a pull request's commit, and of each merge queue group's, and holds it
# until it gets one (netresearch/.github#170 had every queued pull request stuck on "Code scanning
# is still expecting 1 result from CodeQL"), so the workflows' analysis, a minute long, runs
# every time. CodeQL's own result is that check. No weekly run: main gets pushes most days, and
# each analyses with the queries of the action's pinned bundle.
on:
workflow_call:
inputs:
languages:
description: The languages to analyse, as a JSON list.
type: string
required: true
permissions: {}
# Actions are pinned to commits (Dependabot keeps them current, see .github/dependabot.yml).
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
# Default setup's Rust analysis took 15 to 19 minutes with the tests in.
timeout-minutes: 40
permissions:
# Uploading the results to code scanning.
security-events: write
contents: read
strategy:
fail-fast: false
matrix:
language: ${{ fromJSON(inputs.languages) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Nothing is built: Rust and TypeScript are read from the source, which is also what lets
# paths-ignore leave files out.
- uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
languages: ${{ matrix.language }}
build-mode: none
config-file: ./.github/codeql/codeql-config.yml
- uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
category: /language:${{ matrix.language }}