Conversation
- Modified buildCreateOutputAddCommentJob to accept createIssueJobName, createDiscussionJobName, and createPullRequestJobName parameters - Added conditional job dependencies based on which safe output jobs are created - Added environment variables (GITHUB_AW_CREATED_ISSUE_URL, GITHUB_AW_CREATED_DISCUSSION_URL, GITHUB_AW_CREATED_PULL_REQUEST_URL, etc.) to pass output URLs from other jobs - Updated add_comment.cjs to display a "Related Items" section with links to created issues, discussions, and pull requests - Reordered job creation in compiler.go to build create_pull_request before add_comment - Updated all test files that call buildCreateOutputAddCommentJob to pass the new parameters - Added comprehensive test coverage in add_comment_dependencies_test.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Copilot
AI
changed the title
[WIP] Add environment variables for comment referencing
Add job dependencies and environment variables to add_comment for referencing created items
Oct 19, 2025
Collaborator
|
@copilot make sure the create_issue.cjs, create_discussion.cjs and create_pull_pull_request.cjs job setup the outputs properly |
…nd create_pull_request scripts Ensures that job outputs are always set, even when scripts exit early (e.g., in staged mode, when no items are found, or on errors). This prevents the add_comment job from receiving undefined/empty values when referencing these outputs. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Fixed in commit 1693686. All three scripts (create_issue.cjs, create_discussion.cjs, and create_pull_request.cjs) now initialize their outputs to empty strings at the start of the main() function. This ensures outputs are always set, even when the scripts exit early due to staged mode, missing items, or errors. |
github-actions Bot
added a commit
that referenced
this pull request
Oct 20, 2025
This update documents the new feature from PR #2006 where add_comment automatically depends on create_issue, create_discussion, and create_pull_request jobs, and includes a "Related Items" section with links to created items. Key additions: - Documented automatic job dependencies between safe outputs - Explained the Related Items section appended to comments - Listed available environment variables for cross-referencing - Provided configuration examples and generated output format Addresses feature merged in #2006 🤖 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.
Implementation Complete: add_comment Job Dependencies
This PR implements the requirement that the
add_commentjob should depend on (needs) thecreate_issue,create_discussion, andcreate_pull_requestjobs if they are created, and pass their output URLs as environment variables.Changes Completed:
buildCreateOutputAddCommentJobto add conditional job dependenciesImplementation Details:
1. Job Dependencies:
add_commentjob now depends oncreate_issue,create_discussion, andcreate_pull_requestjobs when they existadd_commentdepend on all three jobs2. Environment Variables:
The following environment variables are now passed to the add_comment JavaScript step:
GITHUB_AW_CREATED_ISSUE_URL- URL of the created issueGITHUB_AW_CREATED_ISSUE_NUMBER- Number of the created issueGITHUB_AW_CREATED_DISCUSSION_URL- URL of the created discussionGITHUB_AW_CREATED_DISCUSSION_NUMBER- Number of the created discussionGITHUB_AW_CREATED_PULL_REQUEST_URL- URL of the created pull requestGITHUB_AW_CREATED_PULL_REQUEST_NUMBER- Number of the created pull request3. JavaScript Changes:
add_comment.cjsscript now appends a "Related Items" section to comments when any of the above URLs are available4. Output Initialization:
issue_numberandissue_urloutputs at the startdiscussion_numberanddiscussion_urloutputs at the start5. Job Ordering:
compiler.goto buildcreate_pull_requestbeforeadd_commentso the dependency can be established6. Test Coverage:
add_comment_dependencies_test.gowith comprehensive test cases covering all combinations of job dependenciesExample Output:
When a workflow has
create-issue,create-discussion, andcreate-pull-requestconfigured along withadd-comment, the generated workflow will:add_commentjob:Validation:
make agent-finishOriginal 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.