-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (78 loc) · 3.11 KB
/
Copy pathcodeql.yml
File metadata and controls
88 lines (78 loc) · 3.11 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
77
78
79
80
81
82
83
84
85
86
87
88
# Advanced CodeQL setup so the main-branch ruleset ("Require code scanning
# results" for CodeQL) can receive SARIF uploads. Default/dynamic CodeQL has
# not produced analyses for this repo since early 2026.
name: "CodeQL Advanced"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "24 4 * * 2"
workflow_dispatch: {}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: java-kotlin
build-mode: manual
- language: javascript-typescript
build-mode: none
- language: ruby
build-mode: none
steps:
- name: Checkout repository
# https://github.com/actions/checkout/releases/tag/v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-tags: "true"
fetch-depth: 0
- name: Setup golang
if: matrix.language == 'java-kotlin'
# protobuf generateProto installs protoc-gen-openapiv2 via Go; match
# Meticulous Build so the CodeQL manual Gradle build has the same toolchain.
# https://github.com/actions/setup-go/releases/tag/v5.6.0
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
with:
go-version: "1.22.2"
- name: Set up JDK 21
if: matrix.language == 'java-kotlin'
# https://github.com/actions/setup-java/releases/tag/v4.8.0
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9
with:
java-version: "21"
distribution: "corretto"
- name: Setup Gradle
if: matrix.language == 'java-kotlin'
# https://github.com/gradle/actions/releases/tag/v5.0.0
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2
- name: Initialize CodeQL
# https://github.com/github/codeql-action/releases/tag/v4.37.0
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Build with Gradle Wrapper
# Do not inject repository secrets here. This step runs ./gradlew from
# the PR tree on pull_request events; a malicious contributor could
# alter Gradle scripts to exfiltrate secrets before merge.
# Meticulous Build already compiles/builds this repo on PRs without
# JF credentials, so CodeQL does not need them either.
if: matrix.build-mode == 'manual' && matrix.language == 'java-kotlin'
run: ./gradlew clean compileKotlin -x ktlintCheck
- name: Perform CodeQL Analysis
# https://github.com/github/codeql-action/releases/tag/v4.37.0
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
category: "/language:${{ matrix.language }}"