Add debug step to echo agent outputs in add_comment job#1273
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add echo step for comment job outputs
Add debug step to echo agent outputs in add_comment job
Oct 6, 2025
Collaborator
|
@copilot make sure the echo command is not subject to shell injection. Use env vars. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Fixed in commit 7f6f4ee. The debug step now uses environment variables ( |
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 adds a debug step to the
add_commentjob that echoes the values ofneeds.agent.outputs.outputandneeds.agent.outputs.output_types. This helps with debugging and monitoring the flow of data between the agent job and the add_comment job in agentic workflows.Changes
Modified:
pkg/workflow/add_comment.goAdded a new "Debug agent outputs" step before the "Add Issue Comment" step in the
buildCreateOutputAddCommentJobfunction. The debug step outputs:needs.agent.outputs.outputneeds.agent.outputs.output_typesSecurity: The debug step uses environment variables to safely echo the values, preventing potential shell injection attacks. The GitHub Actions expressions are assigned to environment variables (
AGENT_OUTPUTandAGENT_OUTPUT_TYPES) which are then referenced using shell variable syntax.Example Output in Compiled Workflows
The change generates the following YAML in all workflows using the
add-commentsafe output configuration:Updated Workflows
All compiled
.lock.ymlworkflows that useadd-commenthave been regenerated with the new debug step:Testing
Benefits
This debug step will help:
Security Considerations
The implementation uses environment variables to prevent shell injection vulnerabilities that could occur if the output values contain special shell characters.
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.