-
Notifications
You must be signed in to change notification settings - Fork 12
76 lines (67 loc) · 2.25 KB
/
Copy pathcodeql.yaml
File metadata and controls
76 lines (67 loc) · 2.25 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
72
73
74
75
76
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
name: CodeQL
on:
push:
branches:
- main
# Release branches receive cherry-picked fixes, including security fixes,
# so they need code scanning as much as main does.
- release-*
pull_request:
branches:
- main
- release-*
merge_group:
types:
- checks_requested
workflow_dispatch:
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
permissions:
security-events: write
packages: read
actions: read
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 120
# In merge_group runs, GitHub's merge queue can complete and delete the
# temporary gh-readonly-queue ref before this job finishes uploading its
# SARIF results (Go analysis in particular can take 10+ minutes), which
# makes the upload step fail with a spurious "ref not found" error even
# though the merge itself already succeeded. Don't let that false
# failure block/redden the check; the same commit is also analyzed via
# the pull_request trigger before it ever enters the queue.
continue-on-error: ${{ github.event_name == 'merge_group' }}
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
- language: javascript-typescript
build-mode: none
- language: rust
build-mode: none
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
if: ${{ matrix.language == 'go' }}
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Initialize CodeQL
uses: github/codeql-action/init@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4
with:
category: "/language:${{ matrix.language }}"