Add comment creation for issue/PR reactions with workflow run links#1346
Merged
Add comment creation for issue/PR reactions with workflow run links#1346
Conversation
- Update add_reaction_and_edit_comment.cjs to create comments for issues and pull requests - Rename editCommentWithWorkflowLink to addOrEditCommentWithWorkflowLink to handle both creation and editing - Add comment_id and comment_url outputs to reaction job in reaction.go - Update test expectations to match new function name - Format JavaScript code with prettier Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add TestReactionJobOutputs to verify comment_id and comment_url are exposed - All tests passing - Ready for final review Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update add comment JS for reaction handling
Add comment creation for issue/PR reactions with workflow run links
Oct 8, 2025
- Document new behavior for issues/pull_request events (creates comment) - Document exposed outputs (comment_id, comment_url, reaction_id) - Update command-triggers.md to clarify difference from command workflows - Add behavior section explaining when comments are created vs edited Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Updated documentation in commit e65ccba. Changes include:
|
Collaborator
|
@copilot use Astro Starlight adornment style for notes in docs |
- Convert **Note**: to :::note::: format in command-triggers.md - Follows Starlight documentation conventions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Converted to Starlight adornment style in commit 87bce49. Changed |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Task: Add comment with workflow run link for issue/PR reactions
Problem Statement
When an agentic workflow is triggered by an issue or pull request and has the "reaction" frontmatter enabled, the
add_reactionjob should:Implementation Plan
add_reaction_and_edit_comment.cjsto create comments forissuesandpull_requesteventsreaction.gomake recompileto update compiled workflowsmake agent-finishbefore final commitChanges Made
JavaScript (
add_reaction_and_edit_comment.cjs):issuesevents: Now creates a new comment with workflow run link instead of just adding a reactionpull_requestevents: Now creates a new comment with workflow run link instead of just adding a reactioneditCommentWithWorkflowLinktoaddOrEditCommentWithWorkflowLinkto handle both comment creation and editingcomment-idandcomment-urloutputs when creating commentsGo (
reaction.go):comment_idandcomment_urlto job outputs mapTests:
compiler_test.goto match new function nameaddOrEditCommentWithWorkflowLinkreaction_outputs_test.goto verify comment outputs are properly exposedDocumentation:
docs/src/content/docs/reference/frontmatter.mdto document the new reaction behaviorreaction_id,comment_id, andcomment_urldocs/src/content/docs/reference/command-triggers.mdto clarify the difference between command workflows and non-command workflows with reactions:::noteadornment styleExample Output
When an issue or PR is opened with a reaction-enabled workflow:
YAML outputs:
JavaScript behavior:
issuesevent: Creates comment with text like> Agentic [workflow run](URL) triggered by this issuepull_requestevent: Creates comment with text like> Agentic [workflow run](URL) triggered by this pull requestissue_comment, etc.): Edits existing comment (preserves original behavior)Technical Approach
The change is minimal and focused:
add_comment.cjsOriginal 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.