Skip to content

Commit 8d9b564

Browse files
committed
attest-build-provenance
1 parent f6f1819 commit 8d9b564

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/build-and-sign.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
permissions:
99
contents: read
10-
id-token: write # required for keyless signing
10+
id-token: write # required for GitHub OIDC keyless signing
1111
attestations: write
1212

1313
jobs:
@@ -32,20 +32,29 @@ jobs:
3232
- name: Build with Maven
3333
run: mvn -B -DskipTests package
3434

35-
# 4️⃣ Install Cosign (required internally by provenance action)
35+
# 4️⃣ Ensure artifact exists (fail if missing)
36+
- name: Check JAR exists
37+
run: |
38+
ART=target/demo-oidc-java-1.0.0.jar
39+
if [ ! -f "$ART" ]; then
40+
echo "ERROR: $ART not found!"
41+
exit 1
42+
fi
43+
44+
# 5️⃣ Install Cosign (required internally by provenance action)
3645
- name: Install Cosign
3746
uses: sigstore/[email protected]
3847
with:
3948
cosign-release: "v3.0.2"
4049

41-
# 5️⃣ Generate and sign SLSA provenance for the JAR
50+
# 6️⃣ Generate and sign SLSA provenance for the JAR
4251
- name: Generate and sign build provenance
4352
uses: actions/attest-build-provenance@v1
4453
with:
4554
subject-path: target/demo-oidc-java-1.0.0.jar
4655
github-token: ${{ secrets.GITHUB_TOKEN }}
4756

48-
# 6️⃣ Upload artifacts (JAR + signed provenance)
57+
# 7️⃣ Upload artifacts (JAR + signed provenance)
4958
- name: Upload artifacts
5059
uses: actions/upload-artifact@v4
5160
with:

0 commit comments

Comments
 (0)