Skip to content

Commit 82505f2

Browse files
authored
Refactor goreleaser workflow to use attest-build-provenance (#584)
1 parent 1afeb39 commit 82505f2

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

.github/workflows/goreleaser.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,15 @@ jobs:
8080
env:
8181
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
8282

83-
- name: Generate subject
84-
id: hash
85-
env:
86-
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
87-
run: |
88-
set -euo pipefail
89-
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
90-
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
9183
provenance:
9284
needs: [goreleaser]
9385
permissions:
9486
actions: read # To read the workflow path.
9587
id-token: write # To sign the provenance.
96-
contents: write # To add assets to a release.
97-
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
98-
with:
99-
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
100-
upload-assets: true
101-
private-repository: false
88+
attestations: write # To write attestations
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Attest build provenance (checksums)
92+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
93+
with:
94+
subject-checksums: ./dist/checksums.txt

0 commit comments

Comments
 (0)