-
Notifications
You must be signed in to change notification settings - Fork 148
Add footer boolean field to safe-output configurations (individual and global) #15079
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
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot also allow safe-outputs.footer: false to turn off footer for all safe outputs |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented global footer control in commit 0f3fdb2. You can now use safe-outputs:
footer: false # Global control
create-issue: null
create-pull-request: nullIndividual types can override the global setting: safe-outputs:
footer: false # Global: hide
create-issue: null # Uses global: no footer
create-pull-request:
footer: true # Override: show footerTests verify both global application and local override behavior. |
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.
Pull request overview
Adds a footer boolean option to safe-output configuration so workflows can suppress visible “AI-generated” footer content while still retaining traceability markers, with support for both per-handler and global defaults.
Changes:
- Added
footer: boolsupport to safe-outputs (per handler) andsafe-outputs.footer(global), including schema + docs updates. - Propagated effective footer settings into
GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG(global overridden by local). - Updated JS handlers/helpers and added tests for footer omission behavior.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/update_release.go | Adds Footer *bool to update-release config parsing. |
| pkg/workflow/update_issue.go | Adds Footer *bool to update-issue config parsing. |
| pkg/workflow/update_discussion.go | Adds Footer *bool to update-discussion config parsing. |
| pkg/workflow/safe_outputs_config.go | Extracts global safe-outputs.footer. |
| pkg/workflow/compiler_types.go | Adds Footer *bool to SafeOutputsConfig (global). |
| pkg/workflow/compiler_safe_outputs_config.go | Implements global→local footer precedence and emits footer into handler config JSON. |
| pkg/workflow/create_issue.go | Adds job env var GH_AW_FOOTER=false when local footer disabled. |
| pkg/workflow/create_discussion.go | Adds job env var GH_AW_FOOTER=false when local footer disabled. |
| pkg/workflow/create_pull_request.go | Adds job env var GH_AW_FOOTER=false when local footer disabled. |
| pkg/workflow/safe_outputs_footer_test.go | Adds Go tests for parsing + global/local precedence + handler config JSON. |
| pkg/parser/schemas/main_workflow_schema.json | Documents/validates footer for global + per-handler configs. |
| docs/src/content/docs/reference/frontmatter-full.md | Documents new footer options. |
| pkg/cli/workflows/test-footer-disabled.md | Adds example workflow for per-handler footer disable. |
| pkg/cli/workflows/test-global-footer-override.md | Adds example workflow for global footer + local override. |
| actions/setup/js/update_release.cjs | Passes footer flag into shared body update helper. |
| actions/setup/js/update_issue.cjs | Threads footer flag through update execution path. |
| actions/setup/js/update_discussion.cjs | Adds _includeFooter internal field (but currently unused). |
| actions/setup/js/update_pr_description_helpers.cjs | Adds includeFooter parameter to omit visible footer in update operations. |
| actions/setup/js/update_pr_description_helpers.test.cjs | Adds tests covering includeFooter true/false across operations. |
| actions/setup/js/create_issue.cjs | Supports config.footer !== false to skip visible footer (markers still added). |
| actions/setup/js/create_discussion.cjs | Supports config.footer !== false to skip visible footer (markers still added). |
| actions/setup/js/create_pull_request.cjs | Supports config.footer !== false to skip visible footer (markers still added). |
| actions/setup/js/types/safe-outputs-config.d.ts | Adds footer?: boolean to relevant handler config typings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { currentBody, newContent, operation, workflowName, runUrl, runId, includeFooter = true } = params; | ||
| const aiFooter = includeFooter ? buildAIFooter(workflowName, runUrl) : ""; | ||
|
|
||
| if (operation === "replace") { | ||
| // Replace: use new content with AI footer | ||
| core.info("Operation: replace (full body replacement with footer)"); | ||
| // Replace: use new content with optional AI footer | ||
| core.info("Operation: replace (full body replacement)"); | ||
| return newContent + aiFooter; | ||
| } |
Copilot
AI
Feb 12, 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.
When includeFooter is false, updateBody currently appends/prepends/replaces content without adding any traceability XML markers. The PR description/schema claim markers must still be injected when the visible footer is omitted, so this helper should always add the required XML markers (and only conditionally add the visible attribution/footer text).
| // Add footer flag if explicitly set to false | ||
| if data.SafeOutputs.CreatePullRequests.Footer != nil && !*data.SafeOutputs.CreatePullRequests.Footer { | ||
| customEnvVars = append(customEnvVars, " GH_AW_FOOTER: \"false\"\n") |
Copilot
AI
Feb 12, 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 adds a GH_AW_FOOTER env var, but there’s no consumer in the JS codebase (the handlers read config.footer). This looks like dead/duplicated configuration and can drift from the actual behavior (e.g., global footer settings won’t set this env var). Prefer removing it or wiring it into the JS handlers consistently.
| // Add footer flag if explicitly set to false | |
| if data.SafeOutputs.CreatePullRequests.Footer != nil && !*data.SafeOutputs.CreatePullRequests.Footer { | |
| customEnvVars = append(customEnvVars, " GH_AW_FOOTER: \"false\"\n") | |
| // Log when footer is explicitly disabled (visible footer content will be omitted) | |
| if data.SafeOutputs.CreatePullRequests.Footer != nil && !*data.SafeOutputs.CreatePullRequests.Footer { |
| // Add footer flag if explicitly set to false | ||
| if data.SafeOutputs.CreateIssues.Footer != nil && !*data.SafeOutputs.CreateIssues.Footer { | ||
| customEnvVars = append(customEnvVars, " GH_AW_FOOTER: \"false\"\n") |
Copilot
AI
Feb 12, 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 adds a GH_AW_FOOTER env var, but there’s no consumer in the JS codebase (the handlers read config.footer). This looks like dead/duplicated configuration and can drift from the actual behavior (e.g., global footer settings won’t set this env var). Prefer removing it or wiring it into the JS handlers consistently.
| // Add footer flag if explicitly set to false | |
| if data.SafeOutputs.CreateIssues.Footer != nil && !*data.SafeOutputs.CreateIssues.Footer { | |
| customEnvVars = append(customEnvVars, " GH_AW_FOOTER: \"false\"\n") | |
| // Add footer log if explicitly set to false | |
| if data.SafeOutputs.CreateIssues.Footer != nil && !*data.SafeOutputs.CreateIssues.Footer { |
| customEnvVars = append(customEnvVars, " GH_AW_FOOTER: \"false\"\n") | ||
| discussionLog.Print("Footer disabled - XML markers will be included but visible footer content will be omitted") | ||
| } | ||
|
|
Copilot
AI
Feb 12, 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 adds a GH_AW_FOOTER env var, but there’s no consumer in the JS codebase (the handlers read config.footer). This looks like dead/duplicated configuration and can drift from the actual behavior (e.g., global footer settings won’t set this env var). Prefer removing it or wiring it into the JS handlers consistently.
| customEnvVars = append(customEnvVars, " GH_AW_FOOTER: \"false\"\n") | |
| discussionLog.Print("Footer disabled - XML markers will be included but visible footer content will be omitted") | |
| } | |
| discussionLog.Print("Footer disabled - XML markers will be included but visible footer content will be omitted") | |
| } |
| // Pass footer config to executeUpdate (default to true) | ||
| updateData._includeFooter = config.footer !== false; | ||
|
|
Copilot
AI
Feb 12, 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.
buildDiscussionUpdateData sets updateData._includeFooter, but executeDiscussionUpdate never reads it and the handler never uses updateBody/footer generation. As-is, safe-outputs.update-discussion.footer has no effect. Either implement footer handling for discussion body updates (and strip internal fields before sending to GraphQL), or remove _includeFooter until it’s supported.
| // Pass footer config to executeUpdate (default to true) | |
| updateData._includeFooter = config.footer !== false; |
✅ Implementation Complete: Add
footerboolean field to safe-output configurationsThis PR adds support for a new
footerboolean field in safe-output configurations to control whether AI-generated footers are displayed.Features Implemented
1. Individual Footer Control - Each safe-output type can specify
footer: false:2. Global Footer Control - New top-level
safe-outputs.footer: false:Behavior
Default (footer not specified or footer: true):
With footer: false (individual or global):
<!-- gh-aw-workflow-id: ... --><!-- gh-aw-agentic-workflow: ... -->Example Usage
Individual Control:
Global Control:
Global with Override:
Implementation Details
Backend (Go - 12 files):
Footer *boolto SafeOutputsConfig (global control)Footer *boolto all 6 safe-output config types (individual control)getEffectiveFooter()helper for global → local precedenceFrontend (JavaScript - 8 files):
includeFooter: falseDocumentation:
Test Workflows (2 files):
test-footer-disabled.md- Individual footer controltest-global-footer-override.md- Global control with local overrideTest Coverage
Go Tests:
JavaScript Tests:
Validation:
Backward Compatibility
✅ Fully backward compatible - when
footerfield is not specified at global or individual level, default behavior is to show footerOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.