Skip to content

Commit

Permalink
chore: use sha256 for checksums, re-use existing release for SLSA
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Penner <[email protected]>
  • Loading branch information
matthewpi committed May 20, 2024
1 parent 77a7e75 commit 6bae840
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ jobs:
id: slsa
env:
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
METADATA: "${{ steps.run-goreleaser.outputs.metadata }}"
run: |
set -euo pipefail
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type == "Checksum") | .path')
checksum_file=$(echo "${ARTIFACTS}" | jq -r '.[] | select (.type == "Checksum") | .path')
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
tag_name=$(echo "${METADATA}" | jq -r '.tag')
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
outputs:
hashes: ${{ steps.slsa.outputs.hashes }}
# tag_name: ${{ steps.tag.outputs.tag_name }}
hashes: "${{ steps.slsa.outputs.hashes }}"
tag_name: "${{ steps.slsa.outputs.tag_name }}"

provenance:
name: Provenance
Expand All @@ -78,3 +81,5 @@ jobs:
with:
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
upload-assets: true
# Use the existing release created by Goreleaser instead of creating another.
upload-tag-name: "${{ needs.goreleaser.outputs.tag_name }}"
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ kos:
preserve_import_paths: false

checksum:
algorithm: sha512
algorithm: sha256
name_template: "CHECKSUMS.txt"

sboms:
- artifacts: binary
cmd: syft
args:
- "$artifact"
- "${artifact}"
- "--file"
- "${document}"
- "--output"
Expand Down

0 comments on commit 6bae840

Please sign in to comment.