Repository navigation
71 lines (65 loc) · 2.41 KB
/
Copy pathcodeql.yml
File metadata and controls
71 lines (65 loc) · 2.41 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
# CodeQL analysis.
#
# Code scanning is free for public repositories on GitHub.com -- no GitHub
# Advanced Security license required.
#
# Two TypeScript roots live in this repository: the VS Code extension under
# src/ and the MCP server under mcp/. Each one gets its own scan, pointed at
# that root through the configuration file in .github/codeql/ -- the `paths`
# input of the init step does not exist in codeql-action v4 and is rejected
# with "Unexpected input(s) 'paths'", which is why the scope lives in the
# config file instead.
#
# The scheduled run exists so that newly published CodeQL queries are applied
# to code that has not changed since the last push.
name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Off-peak minute on purpose: many repos share the top-of-hour crons.
- cron: "23 4 * * 1"
# Workflow-level permissions stay read-only. `security-events: write` is
# granted to the analyze job alone, because that is the only step that
# uploads SARIF; a workflow-wide write would give every step -- and every
# action it runs -- the ability to write code-scanning results.
permissions:
contents: read
actions: read
packages: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 30
# A job-level block replaces the workflow-level one, so it restates the
# read permissions the job needs and adds the single write it requires.
permissions:
contents: read
actions: read
packages: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
scope: src
config: ./.github/codeql/codeql-config.yml
- language: javascript-typescript
scope: mcp/src
config: ./.github/codeql/codeql-mcp-config.yml
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
languages: ${{ matrix.language }}
config-file: ${{ matrix.config }}
queries: security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
category: "/language:${{ matrix.language }}:${{ matrix.scope }}"