Skip to content

Commit 7048cf2

Browse files
Scorecard implementation
1 parent d09bade commit 7048cf2

File tree

2 files changed

+47
-8
lines changed

2 files changed

+47
-8
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ jobs:
1010
java: [11, 17]
1111
name: "Java ${{ matrix.java }} build"
1212
steps:
13-
- uses: actions/checkout@v4
13+
- name: Checkout project
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1415
- name: Set up JDK
15-
uses: actions/setup-java@v3
16+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
1617
with:
1718
java-version: ${{ matrix.java }}
1819
distribution: 'temurin'
19-
- name: Cache Maven packages
20-
uses: actions/cache@v3
21-
with:
22-
path: ~/.m2
23-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
24-
restore-keys: ${{ runner.os }}-m2
20+
cache: 'maven'
2521
- name: Run the Maven verify phase
2622
run: mvn -B verify --file pom.xml

.github/workflows/scorecard.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
branch_protection_rule:
4+
schedule:
5+
- cron: '45 0 * * 1'
6+
push:
7+
branches: [ "main" ]
8+
9+
permissions: read-all
10+
11+
jobs:
12+
analysis:
13+
name: Scorecard analysis
14+
runs-on: ubuntu-latest
15+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
16+
permissions:
17+
security-events: write
18+
id-token: write
19+
20+
steps:
21+
- name: "Checkout code"
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- name: "Run analysis"
27+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
28+
with:
29+
results_file: results.sarif
30+
results_format: sarif
31+
publish_results: true
32+
33+
- name: "Upload artifact"
34+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
35+
with:
36+
name: SARIF file
37+
path: results.sarif
38+
retention-days: 5
39+
40+
- name: "Upload to code-scanning"
41+
uses: github/codeql-action/upload-sarif@v3
42+
with:
43+
sarif_file: results.sarif

0 commit comments

Comments
 (0)