Skip to content

Commit f3ec89c

Browse files
authored
Run CodeQL on PRs (#1690)
1 parent 4153e5b commit f3ec89c

File tree

2 files changed

+64
-45
lines changed

2 files changed

+64
-45
lines changed

.github/workflows/codeql-daily.yml

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

.github/workflows/codeql.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- release/*
8+
- v0.*
9+
- v1.*
10+
push:
11+
branches:
12+
- main
13+
- release/*
14+
- v0.*
15+
- v1.*
16+
schedule:
17+
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
analyze:
24+
permissions:
25+
contents: read
26+
actions: read # for github/codeql-action/init to get workflow details
27+
security-events: write # for github/codeql-action/analyze to upload SARIF results
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up Java 17
33+
uses: actions/setup-java@v4
34+
with:
35+
distribution: temurin
36+
java-version: 17
37+
38+
- name: Set up gradle
39+
uses: gradle/actions/setup-gradle@v4
40+
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v3
43+
with:
44+
languages: java, actions
45+
# using "latest" helps to keep up with the latest Kotlin support
46+
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
47+
tools: latest
48+
49+
- name: Assemble
50+
# --no-build-cache is required for codeql to analyze all modules
51+
# --no-daemon is required for codeql to observe the compilation
52+
# (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)
53+
run: ./gradlew assemble --no-build-cache --no-daemon
54+
55+
- name: Perform CodeQL analysis
56+
uses: github/codeql-action/analyze@v3
57+
58+
workflow-notification:
59+
needs:
60+
- analyze
61+
if: always()
62+
uses: ./.github/workflows/reusable-workflow-notification.yml
63+
with:
64+
success: ${{ needs.analyze.result == 'success' }}

0 commit comments

Comments
 (0)