Skip to content

Commit 4deac26

Browse files
feat(ci): attest build provenance (#24)
Estate artifact-attestation rollout mirroring the proven exemplar. Attests: container images (docker-publish.yml + ci.yml docker-build) and release assets (excel zip + LibreOffice oxt).
1 parent 45f1d6f commit 4deac26

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ jobs:
139139
timeout-minutes: 15
140140
needs: [build]
141141
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
142+
permissions:
143+
contents: read
144+
packages: write
145+
id-token: write
146+
attestations: write
142147
steps:
143148
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
144149
- name: Set up Docker Buildx
@@ -161,6 +166,7 @@ jobs:
161166
type=semver,pattern={{major}}.{{minor}}
162167
type=sha
163168
- name: Build and push
169+
id: push
164170
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
165171
with:
166172
context: .
@@ -170,11 +176,21 @@ jobs:
170176
labels: ${{ steps.meta.outputs.labels }}
171177
cache-from: type=gha
172178
cache-to: type=gha,mode=max
179+
- name: Attest container provenance
180+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
181+
with:
182+
subject-name: ghcr.io/${{ github.repository }}
183+
subject-digest: ${{ steps.push.outputs.digest }}
184+
push-to-registry: true
173185
release:
174186
runs-on: ubuntu-latest
175187
timeout-minutes: 15
176188
needs: [build, security]
177189
if: github.event_name == 'release'
190+
permissions:
191+
contents: write
192+
id-token: write
193+
attestations: write
178194
steps:
179195
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
180196
- name: Download Excel add-in
@@ -199,6 +215,12 @@ jobs:
199215
dist/uno/economic-toolkit.oxt
200216
env:
201217
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218+
- name: Attest build provenance
219+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
220+
with:
221+
subject-path: |
222+
economic-toolkit-excel.zip
223+
dist/uno/economic-toolkit.oxt
202224
coverage-report:
203225
runs-on: ubuntu-latest
204226
timeout-minutes: 15

.github/workflows/docker-publish.yml

Lines changed: 10 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
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
2123
- name: Set up Docker Buildx
@@ -38,6 +40,7 @@ jobs:
3840
type=semver,pattern={{major}}.{{minor}}
3941
type=semver,pattern={{major}}
4042
- name: Build and push
43+
id: push
4144
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
4245
with:
4346
context: .
@@ -46,3 +49,10 @@ 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+
if: github.event_name != 'pull_request'
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)