Skip to content

Commit 0d39146

Browse files
feat(ci): attest build provenance (#89)
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 a377160 commit 0d39146

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/publish-container.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
publish:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 15
17+
permissions:
18+
contents: read
19+
packages: write
20+
id-token: write # mint the OIDC token the attestation is signed with
21+
attestations: write # write the build-provenance attestation (the "claim")
1722
steps:
1823
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
1924

@@ -36,10 +41,18 @@ jobs:
3641
type=sha
3742
3843
- name: Build and push
44+
id: push
3945
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v6
4046
with:
4147
context: .
4248
file: ./Containerfile
4349
push: true
4450
tags: ${{ steps.meta.outputs.tags }}
4551
labels: ${{ steps.meta.outputs.labels }}
52+
53+
- name: Attest container provenance
54+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
55+
with:
56+
subject-name: ghcr.io/${{ github.repository }}
57+
subject-digest: ${{ steps.push.outputs.digest }}
58+
push-to-registry: true

0 commit comments

Comments
 (0)