Skip to content

Standardize footer formatting across all safe output JavaScript files#1193

Merged
pelikhan merged 2 commits into
mainfrom
copilot/standardize-footer-formatting
Oct 3, 2025
Merged

Standardize footer formatting across all safe output JavaScript files#1193
pelikhan merged 2 commits into
mainfrom
copilot/standardize-footer-formatting

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 3, 2025

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:

  • Some used > Generated by Agentic Workflow [Run](<url>)
  • The format didn't include the workflow name, making it harder to identify which workflow generated the content
  • The phrasing varied between files

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_NAME environment variable to all safe output job builders in Go:

  • add_comment.go
  • create_issue.go
  • create_pull_request.go
  • create_pr_review_comment.go
  • create_discussion.go

This 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:

  • Read the workflow name from process.env.GITHUB_AW_WORKFLOW_NAME with a fallback to "Workflow"
  • Use the new standardized format: `> AI generated by [${workflowName}](${runUrl})`

Files updated:

  • add_comment.cjs
  • create_issue.ts (TypeScript source)
  • create_pull_request.cjs
  • create_pr_review_comment.cjs
  • create_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

  • ✅ All 393 JavaScript tests passing
  • ✅ All Go unit tests passing
  • ✅ Code formatting validated
  • ✅ Compiled workflows updated and verified
Original prompt

The "create pull request" javascript, "create issue" and "add reaction and comment" javascrtipt files all include a footer in the generated comment. Make sure those comments have the same format, which should like:

> AI generated by [<workflow name>](<run html url>)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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
Copilot AI requested a review from pelikhan October 3, 2025 14:19
@pelikhan pelikhan marked this pull request as ready for review October 3, 2025 14:25
@pelikhan pelikhan merged commit 53560ea into main Oct 3, 2025
23 of 35 checks passed
@pelikhan pelikhan deleted the copilot/standardize-footer-formatting branch October 3, 2025 14:42
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.

2 participants