-
Notifications
You must be signed in to change notification settings - Fork 18
68 lines (61 loc) · 2.33 KB
/
Copy pathcodeql.yml
File metadata and controls
68 lines (61 loc) · 2.33 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 code scanning, advanced setup.
#
# This repository uses advanced setup (this workflow) rather than default setup
# because default setup does not run on pull requests from forks, which leaves
# external contributions permanently blocked by the `code_scanning` rule in the
# `main` ruleset. See https://github.com/github/codeql/issues/19698.
#
# Default setup and advanced setup are mutually exclusive: while default setup is
# enabled, uploads from this workflow are rejected with "CodeQL analyses from
# advanced configurations cannot be processed when the default setup is enabled".
#
# The `pull_request` trigger is used deliberately, not `pull_request_target`.
# Fork pull requests receive a read-only GITHUB_TOKEN, but github/codeql-action
# uploads its SARIF through an endpoint that is exempt from the usual
# `security-events: write` requirement, so analysis of fork pull requests works
# without granting write tokens to untrusted code.
name: "CodeQL Advanced"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '26 19 * * 2'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# Required to upload analysis results.
security-events: write
# Required to fetch internal or private CodeQL packs.
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: go
build-mode: autobuild
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: rust
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
category: "/language:${{matrix.language}}"