File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ name : CodeQL Security Analysis
3+
4+ on :
5+ push :
6+ branches : [main]
7+ pull_request :
8+ branches : [main]
9+ schedule :
10+ - cron : " 29 13 * * 2" # Weekly Tuesday 13:29 UTC
11+
12+ permissions : {}
13+
14+ jobs :
15+ analyze :
16+ name : Analyze Java
17+ runs-on : ubuntu-24.04
18+ permissions :
19+ actions : read # required for github/codeql-action/init to get workflow details
20+ contents : read
21+ security-events : write # required for github/codeql-action/analyze to upload SARIF
22+ steps :
23+ - name : Checkout repository
24+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+ with :
26+ persist-credentials : false
27+
28+ - name : Set up Java
29+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
30+ with :
31+ distribution : temurin
32+ java-version : " 25"
33+
34+ - name : Cache Maven repository
35+ uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
36+ with :
37+ path : ~/.m2/repository
38+ key : ${{ runner.os }}-maven-codeql-${{ hashFiles('**/pom.xml') }}
39+ restore-keys : |
40+ ${{ runner.os }}-maven-codeql-
41+ ${{ runner.os }}-maven-
42+
43+ - name : Initialize CodeQL
44+ uses : github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
45+ with :
46+ languages : java
47+ tools : linked
48+ queries : security-extended
49+
50+ # Do not use autobuild — the multi-module Maven structure requires explicit
51+ # build invocation so that CodeQL can trace the compilation correctly.
52+ # Do not use mise-action here — CodeQL needs to trace the raw Maven build.
53+ - name : Build (CodeQL traces the build)
54+ run : >
55+ ./mvnw clean compile
56+ -DskipTests
57+ -Dcoverage.skip=true
58+ -Dcheckstyle.skip=true
59+ -Djavadoc.skip=true
60+
61+ - name : Perform CodeQL Analysis
62+ uses : github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
63+ with :
64+ category : /language:java
Original file line number Diff line number Diff line change 1+ ---
2+ name : OSSF Scorecard
3+
4+ on :
5+ push :
6+ branches : [main]
7+ schedule :
8+ - cron : " 43 6 * * 5" # Weekly Friday 06:43 UTC
9+ workflow_dispatch :
10+
11+ permissions : {}
12+
13+ jobs :
14+ analysis :
15+ name : Scorecard analysis
16+ runs-on : ubuntu-24.04
17+ # Prevents fork runs from failing due to missing write permissions or secrets.
18+ if : ${{ github.repository == 'prometheus/client_java' }}
19+ permissions :
20+ contents : read
21+ security-events : write # required to upload SARIF results
22+ id-token : write # required by scorecard-action for OIDC token
23+ steps :
24+ - name : Checkout repository
25+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26+ with :
27+ persist-credentials : false
28+
29+ - name : Run OSSF Scorecard analysis
30+ uses : ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
31+ with :
32+ results_file : results.sarif
33+ results_format : sarif
34+ publish_results : true
35+
36+ - name : Upload artifact
37+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
38+ with :
39+ name : SARIF file
40+ path : results.sarif
41+ retention-days : 5
42+
43+ - name : Upload to code scanning
44+ uses : github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
45+ with :
46+ sarif_file : results.sarif
You can’t perform that action at this time.
0 commit comments