Repository navigation
Attest release builds, make the release job re-runnable, document verification - #1
Merged
Merged
Conversation
The release workflow now runs as three jobs with their own permissions: build (contents: read) tests and rebuilds dist/ and checks it matches the tag, attest (id-token and attestations write only, no repository code) signs a build provenance attestation for dist/index.mjs and dist/licenses.txt, and release (contents: write) creates the release with both files attached and moves the major tag. gh release create uploads the assets to a draft before publishing, so the flow works with immutable releases. The major tag stays a plain git tag, not a release, so it remains movable with that setting on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first README example pins the action to the commit of v1.0.0, as the README already advises for every action. A Versions section lists the ways to point at a release (commit SHA, version tag, major tag) and advises against branches. A Verifying a release section shows how to check dist/index.mjs with gh attestation verify --repo DefectDojo/defectdojo-action. SECURITY.md links to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If the release job fails after the release is published, for example when moving the major tag, a re-run used to stop at gh release create because the release exists. It now creates the release only if none exists. A draft left by an earlier run gets its assets replaced and is published. A published release gets only missing assets uploaded, and an attached asset that differs from this build fails the step. .gitattributes marks dist/ as binary so a checkout with core.autocrlf=true keeps the bytes that were attested. The committed files are unchanged. The README's command for finding a release's commit now works for lightweight and annotated tags, and the release workflow's header says to bump the README's pinned SHA after each release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The release workflow now runs as three jobs, each with only the permissions it needs:
contents: read): runs the tests, rebuildsdist/and checks it matches the files committed at the tag.id-token: writeandattestations: writeonly; runs no repository code): creates a build provenance attestation fordist/index.mjsanddist/licenses.txtwithactions/attest-build-provenance, pinned by SHA.contents: write): checks the files match the tag, creates the release with both files attached, and moves the major tag.The release job can be re-run. It creates the release only if none exists. It publishes a draft left by an earlier run. On a release that is already published, it uploads only missing assets and fails if an attached asset differs from the build.
From the next release on, each release carries a build provenance attestation. Verify it with:
The README's first example now pins the action to the commit of v1.0.0. New sections cover how to reference a release (commit SHA, version tag or major tag; never a branch) and how to verify one.
.gitattributesmarksdist/as binary so checkouts withcore.autocrlf=truekeep the attested bytes.Repository settings for an admin (this PR changes none):
v1. It is a plain git tag that the release workflow moves, and an immutable release on it would freeze it.v*.*.*, notv*, so the workflow can still movev1.To check on the first release after merging: the attestation appears under the repository's Attestations, both files are attached to the release,
v1moves, and thegh attestation verifycommand above passes.🤖 Generated with Claude Code