-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 2 KB
/
Copy pathcodeql.yml
File metadata and controls
58 lines (52 loc) · 2 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
name: CodeQL
# Advanced CodeQL setup (replaces GitHub's default code-scanning setup).
# We run the advanced workflow so that .github/codeql/codeql-config.yml's
# `paths-ignore` is actually honoured — the default setup does not reliably
# apply it, which left test/tooling code (Math.random in test ids, canned
# URL checks, local QA scripts) flagged. The default setup must be disabled
# in repo Settings → Code security for this workflow to run.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "30 1 * * 1" # weekly, Monday 01:30 UTC
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
# Code scanning needs GitHub Advanced Security, which a private repository
# on a free plan does not have. The analysis itself completes; the upload
# step is what fails, so the job burns several minutes to end red without
# having told anyone anything. Skipping says the same thing honestly.
#
# Written as a condition rather than a removed trigger so scanning returns
# by itself when the repository goes public. semgrep and gitleaks cover the
# interval — neither depends on Advanced Security.
if: github.event.repository.visibility == 'public'
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
# Mirrors the languages the default setup detected
# (javascript + typescript are analysed together).
language: [javascript-typescript, python, actions]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: none
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"