Harvest one community PR into a release branch with authorship and credit preserved, verified green, and a warm thank-you.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-gh-credit-harvest-f7ce65d8a605 ,按照其中的说明把「gh-credit-harvest」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Harvest exactly one community PR into the real landing branch with full authorship and machine-readable credit, verified green, then thank the contributor. A PR is evidence: judge it from code, tests, comments, and checks, never the title. Do not merge, close, tag, or publish without maintainer approval — this skill lands a credited commit and posts thanks; the workflow closes the PR.
gh-close-issues).<release-branch>); a main-based "mergeable" flag does not prove it lands cleanly.main) and fetch the PR head:
git switch <release-branch>
git fetch origin pull/<N>/head
git log -1 --format='%H %an <%ae>' FETCH_HEAD # author to preserve
gh pr view <N> --repo Hmbown/CodeWhale --json title,author,files,statusCheckRollup
gh pr diff <N> --repo Hmbown/CodeWhale
git merge-tree $(git merge-base HEAD FETCH_HEAD) HEAD FETCH_HEAD # empty/clean = no conflict
git cherry-pick <sha> # one or more commits from FETCH_HEAD
--author and the co-author from .github/AUTHOR_MAP (fall back to numeric noreply):
gh api users/<handle> --jq '"\(.id)+\(.login)@users.noreply.github.com"'
git commit --author="Name <ID+handle@users.noreply.github.com>" -m "fix(scope): what changed (#<N>)" \
-m "Harvested from PR #<N> by @<handle>" \
-m "Co-authored-by: Name <ID+handle@users.noreply.github.com>"
The Harvested from PR #<N> by @<handle> line in the body is what .github/workflows/auto-close-harvested.yml matches to auto-close with credit once the commit reaches main.cargo fmt --all
cargo test -p <crate> # the crate(s) the PR touched, not the whole workspace
git log -1 --format='%an <%ae>%n%(trailers:key=Co-authored-by)' # credit the human, from .github/AUTHOR_MAP
main:
gh pr comment <N> --repo Hmbown/CodeWhale \
--body "Thank you @<handle> — clean fix for <the specific bug>. Harvested into the <release-branch> lane with your authorship preserved; it'll auto-close with credit once it reaches main."
Shape of a clean harvest: a single-commit PR that cherry-picks with no conflicts needs no manual trailers — the author is preserved automatically — and a focused cargo test -p on the touched crate is enough to land it green.
git merge-tree.--author + trailers when you must..github/AUTHOR_MAP, then numeric noreply; never raw third-party, .local, placeholder, or bot emails.Harvested from PR #<N> by @<handle> body line — without it the PR won't auto-close with credit.gh-close-issues.