Standardize footer formatting across all safe output JavaScript files#1193
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
approved these changes
Oct 3, 2025
Copilot
AI
changed the title
[WIP] Refactor comment generation for consistency in footers
Standardize footer formatting across all safe output JavaScript files
Oct 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR standardizes the footer formatting across all JavaScript files that generate GitHub content (issues, pull requests, comments, review comments, and discussions). Previously, these files used inconsistent footer formats when adding AI-generated disclaimers to their output.
Problem
The footer formats were inconsistent across different output types:
> Generated by Agentic Workflow [Run](<url>)Solution
All footer generators now use a standardized format:
> AI generated by [<workflow name>](<run html url>)Implementation Details
1. Environment Variable Addition
Added
GITHUB_AW_WORKFLOW_NAMEenvironment variable to all safe output job builders in Go:add_comment.gocreate_issue.gocreate_pull_request.gocreate_pr_review_comment.gocreate_discussion.goThis variable passes the workflow name (from
data.Name) to the JavaScript runtime, making it available for footer generation.2. JavaScript Updates
Updated footer generation logic in all output files to:
process.env.GITHUB_AW_WORKFLOW_NAMEwith a fallback to"Workflow"`> AI generated by [${workflowName}](${runUrl})`Files updated:
add_comment.cjscreate_issue.ts(TypeScript source)create_pull_request.cjscreate_pr_review_comment.cjscreate_discussion.ts(TypeScript source)3. Test Updates
Updated test expectations to match the new footer format, changing from checking for
"Generated by Agentic Workflow"to"AI generated by".Example
For a workflow named "Code Review Bot", the generated footer will now be:
> AI generated by [Code Review Bot](https://github.com/owner/repo/actions/runs/12345)This provides better traceability by including the workflow name directly in the footer, while maintaining a clickable link to the workflow run for detailed logs.
Testing
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.