Fix push_to_pull_request_branch to use agent_output.json artifact#1889
Merged
Fix push_to_pull_request_branch to use agent_output.json artifact#1889
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Updated buildCreateOutputPushToPullRequestBranchJob to use buildGitHubScriptStep helper - This downloads agent_output.json artifact and sets GITHUB_AW_AGENT_OUTPUT to file path - Matches pattern used by create_issue and other safe-output jobs - All tests pass (unit, integration, and JavaScript tests) - Recompiled all 64 workflows successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Upgrade push_to_pull_request_branch to use agent_outputs.json
Fix push_to_pull_request_branch to use agent_output.json artifact
Oct 17, 2025
pelikhan
approved these changes
Oct 17, 2025
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
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.
Problem
The
push_to_pull_request_branchsafe-output job was failing because it passed agent output as a direct JSON string instead of using theagent_output.jsonartifact file. The JavaScript script (push_to_pull_request_branch.cjs) expectsGITHUB_AW_AGENT_OUTPUTto be a file path that it can read, but the Go code was passing the JSON content directly via${{ needs.agent.outputs.output }}.Error Reference: https://github.com/githubnext/gh-aw/actions/runs/18604513583/job/53050882738#step:5:1
Solution
Updated
buildCreateOutputPushToPullRequestBranchJob()inpkg/workflow/push_to_pull_request_branch.goto use thebuildGitHubScriptStep()helper function, which is the standard pattern used by other safe-output jobs likecreate_issue,add_comment, andcreate_pull_request.What Changed
Before:
After:
The helper function automatically generates steps to:
agent_output.jsonartifact to/tmp/gh-aw/safe-outputs/GITHUB_AW_AGENT_OUTPUT=${{ env.GITHUB_AW_AGENT_OUTPUT }}(file path, not JSON)Benefits
Testing
push_to_pull_request_branch.test.cjs)make agent-finishvalidation passesOriginal 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.