Update activation comment when PR creation fails and issue is created#3780
Merged
Conversation
…d issue is created Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…reation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update comments to reference new issues on create-pull-request failure
Update activation comment when PR creation fails and issue is created
Nov 13, 2025
pelikhan
approved these changes
Nov 13, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the create-pull-request action to update activation comments with issue links when PR creation fails and falls back to creating an issue, maintaining consistency with the existing behavior for successful PR creation.
Key changes:
- Added optional
itemTypeparameter toupdateActivationComment()function to support both pull requests and issues - Integrated activation comment updates in both fallback scenarios (push failure and PR creation failure)
- Added comprehensive test coverage for the new issue link functionality
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/workflow/js/update_activation_comment.cjs |
Added itemType parameter (defaults to "pull_request") to support updating comments with either PR or issue links, with corresponding message formatting |
pkg/workflow/js/update_activation_comment.test.cjs |
Added two new test cases covering issue link updates via both REST API and GraphQL for discussion comments |
pkg/workflow/js/create_pull_request.cjs |
Integrated updateActivationComment() calls in both fallback scenarios (lines 452 and 586) to update activation comments when issues are created |
.github/workflows/*.lock.yml |
Updated compiled workflow files with bundled JavaScript changes, ensuring consistency across all workflow lock files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
When
create-pull-requestfalls back to creating an issue (on push or PR creation failure), the activation comment was not being updated with the issue link, unlike successful PR creation.Changes
update_activation_comment.cjs: Added optionalitemTypeparameter ("pull_request" | "issue") to support both item types. Defaults to "pull_request" for backward compatibility.create_pull_request.cjs: AddedupdateActivationComment()calls in both fallback scenarios:update_activation_comment.test.cjs: Added tests for issue link updates via REST API and GraphQL.Example
Generated messages:
✅ Pull request created: [#42](url)✅ Issue created: [#99](url)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.