Skip to content

Use GFM Alert syntax for discussion-to-issue fallback warning#18268

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-warning-footer-to-issue
Feb 25, 2026
Merged

Use GFM Alert syntax for discussion-to-issue fallback warning#18268
pelikhan merged 2 commits intomainfrom
copilot/add-warning-footer-to-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

The fallback warning added to issues created when create-discussion fails due to permissions was using a plain blockquote, making it easy to overlook.

Change

Replaced the > **Note:** blockquote with a > [!WARNING] GFM Alert in the fallback note appended to the issue body:

> [!WARNING]
> This was intended to be a discussion, but discussions could not be created due to permissions issues. This issue was created as a fallback.
>
> Discussion creation may fail if the specified category is not announcement-capable. Consider using the "Announcements" category or another announcement-capable category in your workflow configuration.

This renders as a visually distinct warning block on GitHub rather than a plain indented paragraph, drawing appropriate attention to the fact that the issue is a fallback artifact.

Original prompt

When create-discussion fails to create a discussion with a permission issue and fallbacks to generate an issue, it should add a clear warning footer in the generate issue that explains what happened. There is already a message but it is too subtle. Use a GFM Alert syntax to draw attention.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

Make sure the user is told to enable discussion and select an Announcement-like category. @copilot

Copilot AI changed the title [WIP] Add clear warning footer to generated issue for discussion failures Use GFM Alert syntax for discussion-to-issue fallback warning Feb 25, 2026
@pelikhan
Copy link
Contributor

@copilot use same style as firewall alert message

@pelikhan pelikhan marked this pull request as ready for review February 25, 2026 05:24
Copilot AI review requested due to automatic review settings February 25, 2026 05:24
@pelikhan pelikhan merged commit 1b6171d into main Feb 25, 2026
1 of 2 checks passed
@pelikhan pelikhan deleted the copilot/add-warning-footer-to-issue branch February 25, 2026 05:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the fallback warning appended to issues created when create-discussion fails (due to permissions) to use GitHub Flavored Markdown (GFM) Alert syntax so it’s more visually prominent.

Changes:

  • Replaced the fallback note formatting from a plain “Note” blockquote to a > [!WARNING] GFM Alert in the generated issue body.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

try {
// Prepare issue message with a note about the fallback
const fallbackNote = `\n\n---\n\n> **Note:** This was intended to be a discussion, but discussions could not be created due to permissions issues. This issue was created as a fallback.\n>\n> **Tip:** Discussion creation may fail if the specified category is not announcement-capable. Consider using the "Announcements" category or another announcement-capable category in your workflow configuration.\n`;
const fallbackNote = `\n\n---\n\n> [!WARNING]\n> This was intended to be a discussion, but discussions could not be created due to permissions issues. This issue was created as a fallback.\n>\n> Discussion creation may fail if the specified category is not announcement-capable. Consider using the "Announcements" category or another announcement-capable category in your workflow configuration.\n`;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback note now relies on GFM Alert syntax (> [!WARNING]), but existing tests only assert that the body contains the explanatory text. Add a test assertion that the created issue body includes the > [!WARNING] marker so this rendering/formatting change can’t silently regress.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants