Skip to content

fix(ci): commit bump-excluded via GitHub API for verified signature#199

Merged
tarotene merged 2 commits into
mainfrom
fix/ci-bump-excluded-verified-commit
May 30, 2026
Merged

fix(ci): commit bump-excluded via GitHub API for verified signature#199
tarotene merged 2 commits into
mainfrom
fix/ci-bump-excluded-verified-commit

Conversation

@tarotene
Copy link
Copy Markdown
Owner

@tarotene tarotene commented May 30, 2026

Summary

  • Replaces git commit && git push in the "Bump excluded crates on release PR" workflow step with GitHub Git Data API calls
  • The API path (POST /git/commits) causes GitHub to auto-sign the commit, producing verified=true — the same mechanism release-plz itself uses
  • No new secrets, GitHub App, or GPG keys required; GITHUB_TOKEN (already available) is sufficient

Background

PR #197 (chore: release v0.2.1) revealed that the bump-excluded commit added by #195 shows Unverified in the GitHub UI. The repository ruleset requires required_signatures on the default branch. While squash merge re-signs the commit on main (so there is no actual regression), the Unverified badge on the release PR branch itself is undesirable and inconsistent with the verified release-plz commits on the same branch.

Implementation

The step now:

  1. Reads the branch HEAD SHA via GET /git/ref/heads/<branch>
  2. Reads the base tree SHA via GET /git/commits/<sha>
  3. Builds the new tree with the two modified Cargo.toml files via POST /git/trees (using jq -n --arg for safe JSON construction)
  4. Creates the commit via POST /git/commits — GitHub auto-signs it
  5. Advances the branch ref via PATCH /git/refs/heads/<branch>

The idempotency guard, just bump-excluded, and git diff --quiet check are unchanged.

Test plan

  • CI passes (fmt / host / tools / msrv / firmware)
  • Merge this PR to main
  • release-plz regenerates PR chore: release v0.2.1 #197: verify the bump-excluded commit shows verified=true via:
    gh api repos/tarotene/telepath/pulls/197/commits --jq '.[].commit.verification'
    
  • Squash merge PR chore: release v0.2.1 #197 → v0.2.1 released

Closes #198

🤖 Generated with Claude Code

The bump-excluded step added in #195 used `git commit && git push` which
produces unsigned commits on the release PR branch. The repository ruleset
requires `required_signatures`; while squash merge re-signs the commit on
main, the Unverified badge on the release PR branch itself is undesirable.

Replace the git commit/push block with GitHub Git Data API calls:
1. Read branch HEAD SHA
2. Build a new tree (POST /git/trees) with the two modified Cargo.toml files
3. Create the commit via POST /git/commits — GitHub auto-signs API commits
4. Advance the branch ref via PATCH /git/refs/heads/<branch>

No new secrets, GitHub App, or GPG keys required; GITHUB_TOKEN is
sufficient. The rest of the step (idempotency guard, just bump-excluded,
git diff --quiet check) is unchanged.

Closes #198

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 30, 2026 08:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the release-plz GitHub Actions workflow to create the “bump excluded crates” commit via the GitHub Git Data API so the commit shows as GitHub-verified on the release PR branch (matching release-plz’s own commits).

Changes:

  • Replace git commit/git push with Git Data API calls to create a tree, create a commit, and fast-forward the PR branch ref.
  • Add workflow comments documenting why the API approach is used (to produce verified commits).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release-plz.yml Outdated
… blobs

$(cat ...) command substitution strips trailing newlines per POSIX, causing
the API-uploaded blobs to lack the final newline present in Cargo.toml files.
Switching to jq --rawfile reads files verbatim and avoids the stripping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tarotene tarotene merged commit d906404 into main May 30, 2026
5 checks passed
@tarotene tarotene deleted the fix/ci-bump-excluded-verified-commit branch May 30, 2026 08:19
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.

fix(ci): bump-excluded commit is unsigned on release PR branch

2 participants