Add --force flag to onboard +welcome for re-adding comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Donkey_kevin 2026-06-15 19:27:24 +08:00
parent be837d4f8e
commit 58c9f77b6b
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ func Shortcuts() []*common.Shortcut {
{Name: "issues", Short: "i", Usage: "Comma-separated issue numbers (e.g. 1,3,7)"},
{Name: "tag", Short: "t", Usage: "Tag name to match (comma-separated)", Default: "good first issue,help wanted"},
{Name: "template", Usage: "Custom welcome message template ({login}, {number}, {subject}, {description})"},
{Name: "force", Short: "f", Usage: "Force re-add even if already commented", Bool: true},
},
DryRun: true,
DryRunHint: dryRunHint,
@ -159,7 +160,8 @@ func processIssues(ctx *common.RuntimeContext, issues []issueInfo) error {
var results []result
for _, issue := range issues {
if hasWelcomeComment(ctx, issue.number) {
force := ctx.Arg("force") == "true"
if !force && hasWelcomeComment(ctx, issue.number) {
results = append(results, result{issue.number, "skipped", fmt.Sprintf("#%d \"%s\" — 已有引导评论,跳过", issue.number, issue.subject)})
continue
}