fix(release): create the release commit via GitHub's GraphQL API#48
Merged
Conversation
main requires signed commits. A plain `git commit` in the runner (as the github-actions[bot] identity, with no signing key configured) would be rejected when pushed. API-created commits (createCommitOnBranch) are verified by GitHub automatically, so no signing key needs to be managed.
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.
Summary
release-prepare.ymlin its original form, which runs a plaingit commitin the runner (as the unauthenticatedgithub-actions[bot]git identity) and pushes it to the newrelease/vX.Y.Zbranch.mainrequires signed commits. Confirmed via a real run (PR chore(release): v0.3.0 #47, now closed): the resultingrelease/v0.3.0branch's commit shows"verified": false, "reason": "unsigned"via the GitHub API, so that PR could never be merged as-is.git commit/git pushstep with.github/scripts/create-verified-commit.mjs, which uses thecreateCommitOnBranchGraphQL mutation to create the commit through GitHub's API instead. API-created commits are automatically shown as Verified — no bot signing key to generate, register, or rotate.git/refs) pointing at the basemainSHA, then the verified commit is added on top of it.Test plan
"verified": true(confirmed on the earlier attempt at this fix, before feat: add automated release workflows #46 merged ahead of it)workflow_dispatch) once this merges and confirm therelease/vX.Y.Zbranch's commit isverified: trueand the resulting PR is mergeable under the signed-commits rulesetrelease/v0.3.0branch and closed PR chore(release): v0.3.0 #47 from the earlier failed attempt🤖 Generated with Claude Code