Skip to content

chore(scripts): add sign-branch.sh ported from mono - #39

Merged
aboodman merged 1 commit into
mainfrom
claude/great-cray-l2ud2x
Sep 18, 2026
Merged

aboodman merged 1 commit into
mainfrom
claude/great-cray-l2ud2x

Conversation

@aboodman

@aboodman aboodman commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This allows us to use cloud-based AI tools like Claude Code (cloud mode) with Rocicorp repos. This is very productive way to work because you can code from couch! (or while doing dishes).

Details

Adds scripts/sign-branch.sh, copied rocicorp/rindle. Idea is we can access this from all repos.

The script rebuilds a branch's commits as the caller's own, SSH-signed with their key, keeping the original author as a Co-authored-by: trailer and preserving the author date. It exists so agent-pushed commits can pass the org-wide "Verify Signed Commit Authors" check.

  • With no branch argument it fetches origin, lists the ten most recently pushed branches with their tip author, and offers an arrow-key menu (j/k, digits, Enter, q).
  • Nothing is checked out: each commit is rebuilt with git commit-tree from the original tree, so the working tree and index are untouched.
  • Only the branch's own commits since its fork point from origin's default branch are touched. Merges are refused.
  • Force-pushes with the lease pinned to the fetched SHA, asking first unless --yes is passed. --no-push parks the rebuilt chain on refs/sign-branch/<branch> for inspection.

Changes from the mono copy

Only the header comment changed. It now points at this repo's .github/signing/allowed_signers and the org-wide .github/workflows/signed-commit-authors.yml required workflow, instead of mono's dev-release.yml. The code is byte-identical.

Test plan

  • bash -n scripts/sign-branch.sh passes.
  • scripts/sign-branch.sh --help prints the usage from the header.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WoZSGU8EFbnz1chH1ofCPx


Generated by Claude Code

@github-actions
github-actions Bot requested a review from darkgnotic September 18, 2026 02:05
Rebuilds a branch's commits as the caller's own, SSH-signed with their
key, keeping the original author as a Co-authored-by trailer. Needed so
agent-pushed commits pass the "Verify signed commit authors" check.

Copied from rocicorp/mono (scripts/sign-branch.sh); only the header
comment changed, to point at this repo's allowed_signers file and the
org-wide signed-commit-authors workflow instead of mono's dev-release
workflow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WoZSGU8EFbnz1chH1ofCPx
@aboodman
aboodman force-pushed the claude/great-cray-l2ud2x branch from aa7ab41 to 762b176 Compare September 18, 2026 02:09
@aboodman
aboodman requested review from grgbkr and removed request for darkgnotic September 18, 2026 02:09
@aboodman
aboodman enabled auto-merge September 18, 2026 02:34
Comment thread scripts/sign-branch.sh
echo "rebuilding:"
git log --reverse --format=' %h %an %s' "$upstream..$head_sha"
echo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add

echo "changes being signed:"
git diff --stat "$upstream" "$head_sha"
echo

So you get a bit more info about what you are signing and might catch if an unexpected file is being edited.

@grgbkr

grgbkr commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

I don't love it, but I accept it. I recognize with local agent authored prs similar rubber stamping can be done.

@aboodman
aboodman added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 6fcf6d0 Sep 18, 2026
4 checks passed
Comment thread scripts/sign-branch.sh
# The rocicorp org requires every commit to be SSH-signed by a key in this repo's
# `.github/signing/allowed_signers`; the org-wide required workflow
# `.github/workflows/signed-commit-authors.yml` enforces it on every pull request. An
# agent-pushed commit carries a good signature made by a key that is not an allowed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont think this is accurate, I don't think agent-pushed commits are signed.

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.

2 participants