Skip to content

feat(check-merge-safety): Comment Matching Feature for Merge Safety Check#779

Merged
avwu99 merged 4 commits intomainfrom
auwu/comment-match-merge-safety
Apr 23, 2026
Merged

feat(check-merge-safety): Comment Matching Feature for Merge Safety Check#779
avwu99 merged 4 commits intomainfrom
auwu/comment-match-merge-safety

Conversation

@avwu99
Copy link
Copy Markdown
Contributor

@avwu99 avwu99 commented Apr 22, 2026

📝 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 input
src/types/generated.ts - Added type declaration
src/helpers/check-merge-safety.ts - Added comment parsing and path matching logic
test/helpers/check-merge-safety.test.ts - Added tests for new functionality
README.md - Added documentation with usage examples

🔗 Related Issues

…778)

Co-authored-by: Austin Wu <auwu@expediagroup.com>
@avwu99 avwu99 requested a review from a team as a code owner April 22, 2026 22:38
@avwu99 avwu99 merged commit de0eac5 into main Apr 23, 2026
10 checks passed
@avwu99 avwu99 deleted the auwu/comment-match-merge-safety branch April 23, 2026 15:31
@eg-oss-ci
Copy link
Copy Markdown

🎉 This PR is included in version 1.87.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants