-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (58 loc) · 2.35 KB
/
codeql.yml
File metadata and controls
69 lines (58 loc) · 2.35 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
name: CodeQL
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Run weekly so the security score stays fresh even without code changes
schedule:
- cron: '30 1 * * 6'
permissions: read-all
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
# Required to upload SARIF results to GitHub Code Scanning
security-events: write
# Required to fetch workflow run info when triggered by a pull_request from a fork
actions: read
strategy:
fail-fast: false
matrix:
language: [ java-kotlin, javascript-typescript ]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Initialize CodeQL
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
languages: ${{ matrix.language }}
# security-extended adds experimental security queries on top of the default suite
# https://docs.github.com/en/code-security/reference/code-scanning/workflow-configuration-options
queries: security-extended
# Java is a compiled language: CodeQL must trace the build to extract facts.
# We reuse the same Maven invocation used in the main CI workflow.
- name: Set up JDK 25
if: matrix.language == 'java-kotlin'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '25'
distribution: 'temurin'
- name: Cache Maven local repository
if: matrix.language == 'java-kotlin'
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.m2/repository
key: maven-codeql-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-codeql-${{ runner.os }}-
- name: Build Java code for CodeQL
if: matrix.language == 'java-kotlin'
run: mvn package -Pfast --file pom.xml --batch-mode
# JavaScript/TypeScript is interpreted: CodeQL analyses the source directly,
# no build step required.
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
category: "/language:${{ matrix.language }}"