-
Notifications
You must be signed in to change notification settings - Fork 180
feat: prefer Announcements category by default for create-discussion #15513
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
48839e4
be0db9b
da99dba
ec45bbe
5d66af0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2191,6 +2191,9 @@ safe-outputs: | |||||
| # available category. Matched first against category IDs, then against category | ||||||
| # names, then against category slugs. Numeric values are automatically converted | ||||||
| # to strings at runtime. | ||||||
| # | ||||||
|
||||||
| # | |
| # |
Copilot
AI
Feb 13, 2026
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.
This section still says “If not specified, uses the first available category.” With the new behavior preferring the “Announcements” category when present, update the description above to match (e.g., prefer Announcements, else first available) so the frontmatter reference stays accurate.
See below for a potential fix:
# category name, or category slug/route. If not specified, prefers an
# announcement-capable category (such as "Announcements") when available;
# otherwise uses the first available category. Matched first against category
# IDs, then against category names, then against category slugs. Numeric values
# are automatically converted to strings at runtime.
#
# Best Practice: Use announcement-capable categories (such as "Announcements")
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -853,12 +853,12 @@ Creates discussions with optional `category` (slug, name, or ID; defaults to fir | |
| ```yaml wrap | ||
| safe-outputs: | ||
| create-discussion: | ||
| title-prefix: "[ai] " # prefix for titles | ||
| category: "general" # category slug, name, or ID (use lowercase) | ||
| expires: 3 # auto-close after 3 days (or false to disable) | ||
| max: 3 # max discussions (default: 1) | ||
| target-repo: "owner/repo" # cross-repository | ||
| fallback-to-issue: true # fallback to issue creation on permission errors (default: true) | ||
| title-prefix: "[ai] " # prefix for titles | ||
| category: "announcements" # category slug, name, or ID (use lowercase, prefer announcement-capable) | ||
| expires: 3 # auto-close after 3 days (or false to disable) | ||
|
Comment on lines
+856
to
+858
|
||
| max: 3 # max discussions (default: 1) | ||
| target-repo: "owner/repo" # cross-repository | ||
| fallback-to-issue: true # fallback to issue creation on permission errors (default: true) | ||
| ``` | ||
|
|
||
| #### Fallback to Issue Creation | ||
|
|
||
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.
In this fallback path,
requestedCategorycomes fromcategoryToMatch, butcategoryToMatchis nevertrim()’d before ID/name/slug comparisons. If an agent outputscategory: "announcements "(trailing space), the match will fail and you’ll unexpectedly fall into this fallback logic. Consider normalizing category inputs withString(...).trim()before matching/fallback.