-
Notifications
You must be signed in to change notification settings - Fork 3.6k
68 lines (62 loc) · 2 KB
/
Copy pathcodeql.yml
File metadata and controls
68 lines (62 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
59
60
61
62
63
64
65
66
67
68
# CodeQL advanced setup.
#
# Scans the same languages the repository's default setup scanned (Actions,
# JavaScript/TypeScript, Python, Rust) with the same default query suite, but
# reads .github/codeql/codeql-config.yml so test paths stay out of alerts.
#
# Gated off by default. While the repository uses CodeQL "Default" setup,
# GitHub rejects SARIF uploads from this workflow ("Code Scanning could not
# process the submitted SARIF"), so the analyze job runs only when the
# repository variable CODEQL_ADVANCED_SETUP is 'true'. The founder flips it
# after switching the repository to "Advanced" setup (Settings -> Code
# security -> Code scanning); until then every run skips the job.
name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly, Tuesday 04:17 UTC.
- cron: '17 4 * * 2'
workflow_dispatch:
permissions: {}
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
if: vars.CODEQL_ADVANCED_SETUP == 'true'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: rust
build-mode: none
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v4
with:
category: /language:${{ matrix.language }}