Skip to content

Commit 2eb9e0c

Browse files
feat(ci): attest build provenance (#93)
Estate artifact-attestation rollout mirroring the proven exemplar. Attested artifacts: - Container image — `container.yml` (subject-name `${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}`, digest from the `Build and push` step, push-to-registry). - Release binaries — `release.yml` (`subject-path: release/*`, the assembled release directory). `publish.yml` deliberately skipped: its softprops step has no `files:` input (ships no binaries), so there is nothing to attest there. All steps use `actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2` (SHA-pinned).
1 parent 2404d63 commit 2eb9e0c

2 files changed

Lines changed: 15 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
20+
attestations: write
1921
steps:
2022
- name: Checkout
2123
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
@@ -37,6 +39,7 @@ jobs:
3739
type=semver,pattern={{major}}.{{minor}}
3840
type=sha
3941
- name: Build and push
42+
id: push
4043
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v5
4144
with:
4245
context: .
@@ -46,3 +49,9 @@ jobs:
4649
labels: ${{ steps.meta.outputs.labels }}
4750
cache-from: type=gha
4851
cache-to: type=gha,mode=max
52+
- name: Attest container provenance
53+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
54+
with:
55+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
56+
subject-digest: ${{ steps.push.outputs.digest }}
57+
push-to-registry: true

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ jobs:
134134
needs: [build-binaries, build-deb, build-rpm]
135135
permissions:
136136
contents: write
137+
id-token: write
138+
attestations: write
137139
steps:
138140
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
139141
- name: Download all artifacts
@@ -152,3 +154,7 @@ jobs:
152154
files: release/*
153155
generate_release_notes: true
154156
draft: false
157+
- name: Attest build provenance
158+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
159+
with:
160+
subject-path: 'release/*'

0 commit comments

Comments
 (0)