Skip to content

Commit 88a91cf

Browse files
authored
ci: add build provenance attestations for release artifacts (aquasecurity#10316)
1 parent 33b9d8e commit 88a91cf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/reusable-release.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
id-token: write # For cosign
2626
packages: write # For GHCR
2727
contents: read # Not required for public repositories, but for clarity
28+
attestations: write # For build provenance attestations
2829
steps:
2930
- name: Cosign install
3031
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
@@ -86,6 +87,7 @@ jobs:
8687
mkdir tmp
8788
8889
- name: GoReleaser
90+
id: goreleaser
8991
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
9092
with:
9193
version: v2.1.0
@@ -116,6 +118,12 @@ jobs:
116118
ghcr.io/aquasecurity/trivy:canary
117119
public.ecr.aws/aquasecurity/trivy:canary
118120
121+
- name: Generate build provenance attestations
122+
if: ${{ inputs.goreleaser_config != 'goreleaser-canary.yml' }}
123+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
124+
with:
125+
subject-checksums: dist/trivy_${{ fromJSON(steps.goreleaser.outputs.metadata).version }}_checksums.txt
126+
119127
- name: Cache Trivy binaries
120128
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
121129
with:

0 commit comments

Comments
 (0)