Skip to content

Commit cf1b608

Browse files
feat(ci): attest build provenance (#55)
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 bf08a66 commit cf1b608

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/trust-pipeline-images.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
name: Build ${{ matrix.service }}
3737
runs-on: ubuntu-latest
3838
timeout-minutes: 15
39+
permissions:
40+
contents: read
41+
packages: write
42+
id-token: write # mint the OIDC token the attestation is signed with
43+
attestations: write # write the build-provenance attestation (the "claim")
3944
strategy:
4045
fail-fast: false
4146
matrix:
@@ -68,6 +73,7 @@ jobs:
6873
type=raw,value=latest,enable={{is_default_branch}}
6974
type=sha
7075
- name: Build and push ${{ matrix.service }}
76+
id: push
7177
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v6
7278
with:
7379
context: services/${{ matrix.service }}
@@ -77,3 +83,9 @@ jobs:
7783
labels: ${{ steps.meta.outputs.labels }}
7884
cache-from: type=gha,scope=${{ matrix.service }}
7985
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
86+
- name: Attest container provenance
87+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
88+
with:
89+
subject-name: ghcr.io/hyperpolymath/${{ matrix.service }}
90+
subject-digest: ${{ steps.push.outputs.digest }}
91+
push-to-registry: true

0 commit comments

Comments
 (0)