Skip to content

ci(release): sign changesets commits via github-api commit mode - #52

Open
jimmy-phantom wants to merge 1 commit into
mainfrom
sign-release-commits
Open

ci(release): sign changesets commits via github-api commit mode#52
jimmy-phantom wants to merge 1 commit into
mainfrom
sign-release-commits

Conversation

@jimmy-phantom

Copy link
Copy Markdown
Collaborator

Problem

main enforces a required-signatures ruleset, but changesets/action defaults to commitMode: git-cli, which produces unsigned commits. Every Version Packages PR therefore lands unmergeable and has to be re-signed by hand before it can be merged (as #51 was).

Fix

Set commitMode: github-api. Per the action's action.yml, that mode routes commits and tags through the GitHub API, where they are "signed using GitHub's GPG key and attributed to the user or app who owns the GITHUB_TOKEN" — i.e. github-actions[bot], Verified.

No org-level setup is involved: signing happens server-side with GitHub's key, so the existing repository-scoped ${{ secrets.GITHUB_TOKEN }} is sufficient and no signing secret or GitHub App install is needed.

Note that setupGitUser becomes a no-op under this mode, since commits no longer go through the git CLI.

Also

Narrows the job's permissions: write-all to what it actually uses:

  • contents: write — release commits, tags, GitHub releases
  • pull-requests: write — creating and updating the version PR
  • id-token: write — required by NPM_CONFIG_PROVENANCE: true

Verification

The next Version Packages PR is the real test; this cannot be exercised without a release run. Confirmed statically that commitMode exists on the pinned changesets/action@v1 ref and that the edited workflow parses as intended.

🤖 Generated with Claude Code

`main` enforces a required-signatures ruleset, but changesets/action
defaults to `commitMode: git-cli`, which produces unsigned commits, so
every Version Packages PR is unmergeable until its commit is re-signed
by hand. `github-api` mode routes commits and tags through the GitHub
API, which signs them with GitHub's key and attributes them to the owner
of GITHUB_TOKEN.

Also narrows the job's `write-all` to the permissions it actually uses:
contents and pull-requests for the release PR and tags, id-token for npm
provenance.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant