Skip to content

Commit 41c51a0

Browse files
authored
Run CodeQL on PRs (#7070)
1 parent bd6b974 commit 41c51a0

File tree

2 files changed

+54
-44
lines changed

2 files changed

+54
-44
lines changed

.github/workflows/codeql-daily.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- release/*
8+
- benchmarks
9+
push:
10+
branches:
11+
- main
12+
- release/*
13+
- benchmarks
14+
schedule:
15+
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
analyze:
22+
permissions:
23+
contents: read
24+
actions: read # for github/codeql-action/init to get workflow details
25+
security-events: write # for github/codeql-action/analyze to upload SARIF results
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
30+
- name: Set up Java 17
31+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
32+
with:
33+
distribution: temurin
34+
java-version: 17
35+
36+
- name: Set up gradle
37+
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
38+
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
41+
with:
42+
languages: java, actions
43+
# using "latest" helps to keep up with the latest Kotlin support
44+
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
45+
tools: latest
46+
47+
- name: Assemble
48+
# --no-build-cache is required for codeql to analyze all modules
49+
# --no-daemon is required for codeql to observe the compilation
50+
# (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands)
51+
run: ./gradlew assemble --no-build-cache --no-daemon
52+
53+
- name: Perform CodeQL analysis
54+
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8

0 commit comments

Comments
 (0)