Repository navigation
ci(release): bind signed assets to the tagged commit - #3017
Merged
Merged
Conversation
upload-assets attaches source-commit.txt with $GITHUB_SHA. sign-release.sh refuses unless it equals the commit the tag names, then GPG-signs it with SHA256SUMS, so a tag moved after its run filled the draft cannot get the old commit's assets signed under it. check-release-signed.sh verifies source-commit.txt.asc and that the file names the tag's commit before publish-crates uploads anything. Closes #2397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #2397
What
release.ymlupload-assetswritessource-commit.txt($GITHUB_SHA) next toSHA256SUMSand uploads it to the draft.sign-release.shaddssource-commit.txtto the GPG sign targets. After download it refuses unless the file is one line equal togit rev-parse "refs/tags/$TAG^{commit}". A tag moved after its run filled the draft now stops the script before anything is signed.check-release-signed.sh(publish-crates) takes the tag's commit as a third argument. It verifiessource-commit.txt.ascagainst KEYS with the same live-key rules asSHA256SUMS.asc, and checks that the file names that commit.publish-crates.ymlpassessteps.signature.outputs.sha.The optional image
org.opencontainers.image.revisioncross-check is left out: it needs a registry round trip per image and adds nothing the signed commit file does not already bind.Tests
scripts/tests/test_sign_release_publish.py: the shim stagessource-commit.txt; new cases cover a draft built from another commit, a missing file, and a two-line file. All of them refuse before signing or uploading. The happy path assertssource-commit.txt.ascis uploaded..github/scripts/tests/test_check_release_signed.py: missing file/signature, commit mismatch, tampered file, two-line file.shellcheckis clean on both scripts, andpre-commit run --filespasses.mainin this environment: the macOS/private/varpath, localsha256sum --stricton a blank line, and git-cliff. They are not caused by this change.🤖 Generated with Claude Code