Skip to content

Commit 9ad8183

Browse files
committed
šŸ” ci(security): add CodeQL analysis workflow for Java 21 multi-module build
- Introduced `.github/workflows/codeql.yml` for CodeQL static analysis - Runs on `push`, `pull_request`, and weekly schedule - Builds both `customer-service` and `customer-service-client` modules - Reports results to GitHub Security → Code scanning alerts - Ensures minimal permissions (`security-events: write`, `contents: read`) Improves overall security posture and enables automated vulnerability detection.
1 parent 897d8b1 commit 9ad8183

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

ā€Ž.github/workflows/codeql.ymlā€Ž

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '18 3 * * 1'
10+
11+
permissions:
12+
contents: read
13+
security-events: write
14+
actions: read
15+
16+
jobs:
17+
analyze:
18+
name: Analyze (CodeQL)
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up JDK 21
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '21'
29+
distribution: 'temurin'
30+
cache: maven
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@v3
34+
with:
35+
languages: java
36+
- name: Build (customer-service)
37+
run: mvn -q -ntp -DskipTests=true clean package
38+
working-directory: customer-service
39+
40+
- name: Build (customer-service-client)
41+
run: mvn -q -ntp -DskipTests=true clean package
42+
working-directory: customer-service-client
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@v3
46+
with:
47+
category: "/language:java"

0 commit comments

Comments
Ā (0)