ci: diff against PR merge base, not current main tip#416
Merged
Conversation
The changed-MCPs detection used `git diff $BASE HEAD`, which compares the current tip of main to HEAD — so any path main has touched since the PR forked appeared as "changed" too. Switching to `$BASE...HEAD` uses the merge base, restricting the list to what the PR actually modified. Locally on this branch the result drops from 10 paths (.github, bun.lock, discord, dropbox, github, google-gmail, …) down to the real 3 (.github, hyperdx, scripts). Co-Authored-By: Claude Opus 4.7 <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.
Summary
The changed-MCPs detection in
checks.ymlusedgit diff "$BASE" HEAD, which compares the current tip ofmainagainstHEAD. So whenevermainhad moved ahead since the PR forked, every path touched onmainshowed up as "changed" too — and theRun type check/Run testssteps ran for MCPs that weren't actually modified by the PR.Switching to
"$BASE"...HEAD(three-dot) uses the merge base, restricting the list to what the PR actually changed.Real example, this branch's parent PR (#403) on the previous CI run:
.github bun.lock deploy.json discord discord-read dropbox github google-gmail package.json vtex.github hyperdx scriptsTest plan
git diff --name-only origin/main...HEADreturns only the paths this PR touches.github(no MCP test/check runs, since no MCP source changed)Summary by cubic
Fix CI changed-MCP detection by diffing against the PR merge base (
git diff "$BASE"...HEAD) instead of the currentmaintip. This prevents unrelated MCP jobs from running whenmainmoves and runs checks only for paths changed by the PR.Written for commit be1fe7f. Summary will update on new commits.