Use to assign GitHub issues to a milestone and/or owners in bulk, verifying each.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-gh-assign-issues-3588f905b1a1 ,按照其中的说明把「gh-assign-issues」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Retarget or assign a set of Codewhale issues to a milestone and/or owners in
bulk, verifying every one. The milestone (or assignee) change is the signal;
do not narrate it with comments. Use gh for all GitHub
calls.
vX.Y.Z, or to assign to owners.This skill changes milestone/assignee only. It does not close, label, comment, merge, or release. Those stay with the maintainer.
Confirm the exact milestone title. gh issue edit --milestone matches by
name, so a typo silently fails (or worse, no-ops). Read the real titles and
note the starting open-count:
gh api repos/Hmbown/CodeWhale/milestones \
--jq '.[] | "\(.number)\t\(.title)\topen=\(.open_issues)\tstate=\(.state)"'
Copy the title string verbatim (e.g. the live vX.Y.Z title). If the target
milestone is missing or closed, stop and ask the maintainer; do not create one.
Pre-flight each number. gh issue edit will happily retarget a PR or a
closed issue, so screen first. The url reveals PR-vs-issue (/pull/ vs
/issues/); skip anything not OPEN or that is a PR:
for N in <N1> <N2> <N3>; do # substitute the real issue numbers
gh issue view "$N" --repo Hmbown/CodeWhale \
--json number,state,url,milestone \
--jq '"\(.number)\t\(.state)\t\(.url)\tmilestone=\(.milestone.title // "none")"'
done
Flag any row whose url contains /pull/ (it is a PR) or whose state is
not OPEN, and exclude it from the loop below.
Apply the change, one issue at a time, reporting per-issue success. Use
--milestone, --add-assignee, or both:
for N in <N1> <N2> <N3>; do # substitute the real issue numbers
if gh issue edit "$N" --repo Hmbown/CodeWhale \
--milestone "<milestone>" >/dev/null 2>&1; then
echo "ok #$N -> <milestone>"
else
echo "FAIL #$N (PR? closed? bad milestone title?)"
fi
done
# owners: add --add-assignee handle (do not invent logins)
Edit is idempotent: re-pointing an already-correct issue is harmless.
Verify the milestone moved. Re-run the step-1 command and confirm the open
count rose by the number of issues you moved in (minus any you skipped).
Spot-check a few with the step-2 view to confirm milestone.title is now
the target.
Report a tight ledger: issues moved, issues skipped and why (PR / closed / title mismatch), the before/after open-count, and any owner assignments. No public comment is posted.
/pull/ in the url), before editing.Co-authored-by / Harvested from PR #N), or closing references.