Skip to content

Commit 42450ba

Browse files
feat(ci): attest build provenance (#58)
Adds GitHub native build-provenance attestation to the container publish (id-token+attestations perms, digest captured from build-push, attest-build-provenance binds the pushed image). Part of the estate artifact-attestation rollout; mirrors the proven exemplar. Verify: gh attest verify oci://<image>:<tag> --repo <repo>. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b610b74 commit 42450ba

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/container.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
permissions:
1717
contents: read
1818
packages: write
19+
id-token: write # mint the OIDC token the attestation is signed with
20+
attestations: write # write the build-provenance attestation (the "claim")
1921
steps:
2022
- name: Checkout
2123
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
@@ -40,6 +42,7 @@ jobs:
4042
type=sha
4143
type=raw,value=latest,enable={{is_default_branch}}
4244
- name: Build and push (multi-arch)
45+
id: push
4346
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v5
4447
with:
4548
context: .
@@ -52,3 +55,9 @@ jobs:
5255
cache-to: type=gha,mode=max
5356
provenance: true
5457
sbom: true
58+
- name: Attest container provenance
59+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
60+
with:
61+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
62+
subject-digest: ${{ steps.push.outputs.digest }}
63+
push-to-registry: true

0 commit comments

Comments
 (0)