Skip to content

fix: update-pull-request honors footer: false#17525

Merged
pelikhan merged 4 commits intomainfrom
copilot/fix-update-pull-request-footer
Feb 21, 2026
Merged

fix: update-pull-request honors footer: false#17525
pelikhan merged 4 commits intomainfrom
copilot/fix-update-pull-request-footer

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

update-pull-request always appended an AI attribution footer regardless of configuration, unlike all other safe outputs which respect footer: false.

Changes

  • UpdatePullRequestsConfig (update_pull_request.go): Added Footer *bool field and registered it for YAML parsing.
  • compiler_safe_outputs_config.go: Added getEffectiveFooter propagation to the update_pull_request handler config, enabling both local and global footer suppression.
  • update_pull_request.cjs: buildPRUpdateData now stores _includeFooter = config.footer !== false; executePRUpdate extracts it and passes to updateBody().
  • update_pr_description_helpers.cjs: buildAIFooter now uses the common generateFooterWithMessages() helper (consistent with create_issue and create_pull_request), including installation instructions, XML metadata marker, missing info/blocked-domains sections. updateBody now also adds generateWorkflowIdMarker(workflowId) when footer is disabled, preserving searchability.
  • safe_outputs_footer_test.go: Extended global footer test to cover update_pull_request.
  • JSON Schema (main_workflow_schema.json): Added footer property to update-pull-request.
  • safe-outputs.md: Added footer: false to the update-pull-request code example.
  • footers.md: Added update-pull-request to the list of safe output types affected by global footer: false.

Usage

safe-outputs:
  update-pull-request:
    footer: false  # No AI attribution footer appended to PR body

Or globally:

safe-outputs:
  footer: false  # Suppresses footer across all safe outputs, including update-pull-request
Original prompt

This section details on the original issue you should resolve

<issue_title>update-pull-request should honor footer: false</issue_title>
<issue_description>update-pull-request appears to always append a footer.

It should honor safe-outputs.update-pull-request.footer: false (consistent with other safe outputs).

Expected: when footer: false, no visible footer is added to PR body updates.

As a workaround you can provide a relatively short/blank footer to messages.footer but that's a bit annoying.</issue_description>

Comments on the Issue (you are @copilot in this section)


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

- Add Footer field to UpdatePullRequestsConfig struct
- Propagate footer config in compiler_safe_outputs_config.go
- Pass _includeFooter flag through buildPRUpdateData/executePRUpdate
- Add update-pull-request to global footer test coverage

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix update-pull-request to honor footer: false fix: update-pull-request honors footer: false Feb 21, 2026
@pelikhan
Copy link
Contributor

@copilot review the main JSON Schema and docs to make sure footer is documented

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

Copilot AI commented Feb 21, 2026

@copilot review the main JSON Schema and docs to make sure footer is documented

Done in 3023bf3. Updated:

  • JSON Schema (pkg/parser/schemas/main_workflow_schema.json): Added footer property to update-pull-request with description matching the update-issue pattern.
  • safe-outputs.md: Added footer: false to the update-pull-request code example.
  • footers.md: Added update-pull-request to the list of safe output types affected by the global footer: false setting.

@pelikhan
Copy link
Contributor

@copilot review footer implementation and compare to other footer implementation like create-issue. Make sure you use common helpers.

…ption_helpers

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

Copilot AI commented Feb 21, 2026

@copilot review footer implementation and compare to other footer implementation like create-issue. Make sure you use common helpers.

Done in c35bb81. Updated update_pr_description_helpers.cjs to align with the create_issue/create_pull_request pattern:

  • buildAIFooter now uses generateFooterWithMessages() (the common helper) instead of the simpler getFooterMessage(). This includes installation instructions, missing info/blocked-domain sections, and the XML metadata comment marker for traceability.
  • updateBody now adds generateWorkflowIdMarker(workflowId) even when footer: false, so items remain searchable — consistent with how create_issue and create_pull_request handle the disabled-footer case.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js (http block)
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js 787240/b081/vet.rev-parse k/gh-aw/gh-aw/ac--abbrev-ref k/gh-aw/gh-aw/acHEAD -c git rev-parse --abbrev-ref HEAD 0/x64/bin/node bin/node (http block)
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js --no-file-parall-c odules/npm/node_git rev-parse --abbrev-ref HEAD git rev-�� --abbrev-ref HEAD tions/setup/js/node_modules/.bin/git featurewhoami 0/x64/bin/node t ache/node/24.13.--conditions (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan marked this pull request as ready for review February 21, 2026 17:18
Copilot AI review requested due to automatic review settings February 21, 2026 17:18
@pelikhan pelikhan merged commit 50ab544 into main Feb 21, 2026
118 checks passed
@pelikhan pelikhan deleted the copilot/fix-update-pull-request-footer branch February 21, 2026 17:23
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

This PR adds support for the footer: false configuration option to the update-pull-request safe output, allowing users to suppress the AI-generated footer while preserving XML metadata markers for searchability. This brings consistency with other safe outputs (create-issue, create-pull-request, update-issue, etc.) which already honor this configuration.

Changes:

  • Added Footer field to UpdatePullRequestsConfig struct in Go backend with YAML parsing support
  • Propagated footer configuration from global and local settings to the JavaScript handler
  • Updated buildAIFooter to use generateFooterWithMessages for consistency with create operations, including installation instructions and metadata
  • Added workflow-id XML marker when footer is disabled to preserve searchability
  • Updated JSON schema and documentation to reflect the new configuration option
  • Extended tests to verify global footer configuration affects update-pull-request

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/update_pull_request.go Added Footer *bool field to config struct and registered it for YAML parsing
pkg/workflow/compiler_safe_outputs_config.go Added footer propagation to handler config using getEffectiveFooter helper
pkg/workflow/safe_outputs_footer_test.go Extended global footer test to verify update-pull-request inherits footer setting
actions/setup/js/update_pull_request.cjs Added footer flag extraction and propagation to updateBody helper
actions/setup/js/update_pr_description_helpers.cjs Enhanced buildAIFooter to use generateFooterWithMessages; added workflow-id marker when footer disabled
actions/setup/js/update_pr_description_helpers.test.cjs Updated test expectation to verify workflow-id marker presence when footer disabled
pkg/parser/schemas/main_workflow_schema.json Added footer property to update-pull-request schema with description
docs/src/content/docs/reference/safe-outputs.md Documented footer: false configuration option in example
docs/src/content/docs/reference/footers.md Added update-pull-request to list of affected safe output types

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

includeFooter: false,
});
expect(result).toBe("Replacement");
expect(result).toBe("Replacement\n\n<!-- gh-aw-workflow-id: test-workflow -->");
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

After fixing the bug on line 92 (making the workflow ID marker unconditional), this test expectation will need to be updated. The workflow ID marker should be present in the output regardless of the includeFooter setting. Additionally, tests should be added to verify that the workflow ID marker is present when includeFooter is true (currently only line 461 tests for it when false).

Copilot uses AI. Check for mistakes.
// When footer is enabled use the full footer (includes install instructions, XML marker, etc.)
// When footer is disabled still add standalone workflow-id marker for searchability
const aiFooter = includeFooter ? buildAIFooter(workflowName, runUrl) : "";
const workflowIdMarker = !includeFooter && workflowId ? `\n\n${generateWorkflowIdMarker(workflowId)}` : "";
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The workflow ID marker should be added unconditionally (when workflowId is present), not just when includeFooter is false. This creates an inconsistency with create_issue and create_pull_request, which always add the workflow-id marker for searchability.

In create_issue.cjs (line 446-448) and create_pull_request.cjs (line 489-491), the workflow-id marker is added unconditionally with the comment "Always add XML markers even when footer is disabled". The same pattern should be followed here.

Change line 92 from:

const workflowIdMarker = !includeFooter && workflowId ? `\n\n${generateWorkflowIdMarker(workflowId)}` : "";

to:

const workflowIdMarker = workflowId ? `\n\n${generateWorkflowIdMarker(workflowId)}` : "";

This ensures the workflow-id marker is always present for searchability, regardless of footer settings.

Suggested change
const workflowIdMarker = !includeFooter && workflowId ? `\n\n${generateWorkflowIdMarker(workflowId)}` : "";
const workflowIdMarker = workflowId ? `\n\n${generateWorkflowIdMarker(workflowId)}` : "";

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.

update-pull-request should honor footer: false

3 participants