Skip to content

Commit b55cc30

Browse files
aksOpsclaude
andauthored
ci(release): add SLSA provenance + switch to softprops/action-gh-release (#41)
Fixes two scorecard warnings: - Signed-Releases warning 'does not have provenance': adds actions/attest-build-provenance@v4.1.0 after cosign signing. It produces a Sigstore-signed in-toto attestation bundle covering both binaries and SHA256SUMS; bundle is uploaded with the release as docsiq-<tag>.intoto.jsonl. - Packaging 'packaging workflow not detected': replaces the raw 'gh release create' call with softprops/action-gh-release@v3.0.0, the pattern scorecard's Packaging check recognises. Same behaviour: creates tag on the triggering SHA, uploads all dist/* assets, auto-generates release notes. Requires attestations: write permission on the release job. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9e7f3c3 commit b55cc30

1 file changed

Lines changed: 30 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ jobs:
151151
runs-on: ubuntu-latest
152152
permissions:
153153
contents: write
154-
id-token: write # required for cosign keyless signing
154+
id-token: write # required for cosign keyless signing
155+
attestations: write # required for actions/attest-build-provenance
155156
steps:
156157
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
157158
with:
@@ -193,16 +194,34 @@ jobs:
193194
--output-certificate SHA256SUMS.pem \
194195
SHA256SUMS
195196
196-
- name: Create tag + release
197-
env:
198-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197+
# SLSA build provenance — scorecard's Signed-Releases check asks
198+
# for in-toto attestations alongside the cosign sigs. The bundle
199+
# covers both binaries and SHA256SUMS.
200+
- name: Generate SLSA build provenance
201+
id: attest
202+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
203+
with:
204+
subject-path: |
205+
dist/docsiq-*-linux-amd64
206+
dist/docsiq-*-darwin-arm64
207+
dist/SHA256SUMS
208+
209+
- name: Copy attestation into dist
199210
run: |
200211
set -eu
201-
tag="${{ needs.tag.outputs.tag }}"
202-
git tag "$tag"
203-
git push origin "$tag"
204-
gh release create "$tag" \
205-
--target "${{ github.sha }}" \
206-
--generate-notes \
207-
--title "$tag" \
212+
cp "${{ steps.attest.outputs.bundle-path }}" \
213+
dist/docsiq-${{ needs.tag.outputs.tag }}.intoto.jsonl
214+
215+
# softprops/action-gh-release is the pattern scorecard's Packaging
216+
# check recognises, replacing our ad-hoc `gh release create`.
217+
# Creates the tag on the triggering SHA when it doesn't yet exist.
218+
- name: Create GitHub release
219+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
220+
with:
221+
tag_name: ${{ needs.tag.outputs.tag }}
222+
name: ${{ needs.tag.outputs.tag }}
223+
target_commitish: ${{ github.sha }}
224+
generate_release_notes: true
225+
make_latest: 'true'
226+
files: |
208227
dist/*

0 commit comments

Comments
 (0)