Skip to content

feat(scripts): add sign-pr.sh to sign a PR by number, fork branches included - #43

Closed
arv wants to merge 1 commit into
mainfrom
arv/sign-pr
Closed

arv wants to merge 1 commit into
mainfrom
arv/sign-pr

Conversation

@arv

@arv arv commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

sign-branch.sh only looks at origin, so it cannot sign a PR whose branch lives on a contributor's fork (for example rocicorp/mono#6683, on pawarren/mono).

scripts/sign-pr.sh [<pr-number>] [--repo owner/name] [--yes] [--no-push]:

  • Resolves the PR's head repo and branch with gh, fetches and pushes by URL, so a fork works when the PR allows maintainer edits. Refuses closed PRs and forks that disallow edits.
  • Rebuilds commits the same way sign-branch.sh does: git commit-tree from the original tree (asserted identical), you as author, signed, original author date, original author kept as a Co-authored-by: trailer. Commits already authored and signed by you keep their SHA; merges are refused.
  • Force-pushes with the lease pinned to the fetched head, after a prompt unless --yes. --no-push leaves the chain at refs/sign-pr/<n> and prints the push command.
  • With no PR number, an arrow-key picker of the ten most recently updated open PRs, like sign-branch.sh.
  • Adds the trailer with --if-exists addIfDifferent; see fix(scripts): keep the original author when a Co-authored-by already exists #42 for the same fix in sign-branch.sh.

Used to sign rocicorp/mono#6683.

…ncluded

sign-branch.sh only looks at origin, so it cannot sign a PR whose branch
lives on a contributor's fork. sign-pr.sh resolves the PR's head repo and
branch with gh, fetches and pushes by URL (so a fork works when the PR allows
maintainer edits), and otherwise rebuilds commits the same way: identical
trees, you as author, signed, original author date, original author kept as a
Co-authored-by trailer. With no PR number it offers an arrow-key picker of the
ten most recently updated open PRs.
@arv

arv commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #44, which adds PR support to sign-branch.sh instead of a separate script.

@arv arv closed this Sep 28, 2026
@arv
arv deleted the arv/sign-pr branch September 28, 2026 15:00
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