feat(check-merge-safety): Comment Matching Feature for Merge Safety Check#779
Merged
feat(check-merge-safety): Comment Matching Feature for Merge Safety Check#779
Conversation
…778) Co-authored-by: Austin Wu <auwu@expediagroup.com>
added 3 commits
April 22, 2026 17:45
danadajian
approved these changes
Apr 23, 2026
|
🎉 This PR is included in version 1.87.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
📝 Description
Summary
Adds match_comment_paths parameter to check-merge-safety helper that reads paths from a specially formatted PR comment and checks if the branch is behind on any of those paths
Solves the edge case where selective testing runs tests for paths beyond what a PR directly modifies (e.g., transitive dependencies in monorepos), but merge safety only checked direct file changes
When enabled, the helper looks for a comment with the marker containing a JSON array of paths
Problem
In monorepos with selective testing, a PR changing PackageA might trigger tests for PackageB (a dependent). If someone merges changes to PackageB on main, the original PR's tests become stale, but the existing merge safety check wouldn't catch this since it only compared direct file changes.
Solution
Allow CI to post a comment with all paths covered by the PR's tests. The merge safety check then uses these paths (in addition to existing checks) to determine if a rebase is needed.
Files Changed
action.yml- Added match_comment_paths inputsrc/types/generated.ts- Added type declarationsrc/helpers/check-merge-safety.ts- Added comment parsing and path matching logictest/helpers/check-merge-safety.test.ts- Added tests for new functionalityREADME.md- Added documentation with usage examples🔗 Related Issues