-
Notifications
You must be signed in to change notification settings - Fork 1
fix(phase-3): normalize workflows and fix CLI command references #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -386,7 +386,7 @@ export const GITHUB_COMMANDS: CommandRegistry = { | |||||||||||
|
|
||||||||||||
| 'post-comment': { | ||||||||||||
| name: 'post-comment', | ||||||||||||
| description: 'Post a comment on an issue. Usage: post-comment --issue-number 216 --body "text" [--body-file /path] [--type plan]', | ||||||||||||
| description: 'Post a comment on an issue. Usage: post-comment --issue-number 216 --body "text" [--body-file /path] [--type plan] [--plan-number 1]', | ||||||||||||
| async handler(args) { | ||||||||||||
| let issueNumber: number; | ||||||||||||
| try { | ||||||||||||
|
|
@@ -413,8 +413,13 @@ export const GITHUB_COMMANDS: CommandRegistry = { | |||||||||||
| } | ||||||||||||
|
|
||||||||||||
| const commentType = getFlag(args, '--type'); | ||||||||||||
| const planNumber = getIntFlag(args, '--plan-number'); | ||||||||||||
| if (commentType) { | ||||||||||||
| const header = formatCommentHeader({ type: commentType as Parameters<typeof formatCommentHeader>[0]['type'] }); | ||||||||||||
| const meta: Record<string, unknown> = { type: commentType }; | ||||||||||||
| if (planNumber !== undefined && !Number.isNaN(planNumber)) { | ||||||||||||
| meta.plan = planNumber; | ||||||||||||
| } | ||||||||||||
| const header = formatCommentHeader(meta as Parameters<typeof formatCommentHeader>[0]); | ||||||||||||
| body = `${header}\n${body}`; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
|
@@ -573,7 +578,7 @@ export const GITHUB_COMMANDS: CommandRegistry = { | |||||||||||
|
|
||||||||||||
| 'delete-comments': { | ||||||||||||
| name: 'delete-comments', | ||||||||||||
| description: 'Delete comments of a given type from an issue. Usage: delete-comments --issue-number 216 --type plan', | ||||||||||||
| description: 'Delete comments of a given type from an issue. Supports comma-separated types. Usage: delete-comments --issue-number 216 --type plan,context,research', | ||||||||||||
| async handler(args) { | ||||||||||||
| let issueNumber: number; | ||||||||||||
| try { | ||||||||||||
|
|
@@ -584,26 +589,30 @@ export const GITHUB_COMMANDS: CommandRegistry = { | |||||||||||
| return cmdErr((e as Error).message); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| let type: string; | ||||||||||||
| let typeRaw: string; | ||||||||||||
| try { | ||||||||||||
| type = getRequiredFlag(args, '--type'); | ||||||||||||
| typeRaw = getRequiredFlag(args, '--type'); | ||||||||||||
| } catch (e) { | ||||||||||||
| return cmdErr((e as Error).message); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| // Support comma-separated types (e.g. "plan,context,research") | ||||||||||||
| const types = new Set(typeRaw.split(',').map((t) => t.trim()).filter(Boolean)); | ||||||||||||
|
||||||||||||
| const types = new Set(typeRaw.split(',').map((t) => t.trim()).filter(Boolean)); | |
| const types = new Set(typeRaw.split(',').map((t) => t.trim()).filter(Boolean)); | |
| if (types.size === 0) { | |
| return cmdErr('--type must contain at least one non-empty comment type'); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--plan-numberis parsed even when--typeis not provided, but it has no effect because the metadata header is only prepended insideif (commentType). Consider either (a) erroring when--plan-numberis provided without--type, or (b) treating--plan-numberas implying--type plan, to avoid silently ignoring the flag.