Skip to content

ci: diff against PR merge base, not current main tip#416

Merged
JonasJesus42 merged 1 commit into
mainfrom
JonasJesus42/ci-test-step
May 4, 2026
Merged

ci: diff against PR merge base, not current main tip#416
JonasJesus42 merged 1 commit into
mainfrom
JonasJesus42/ci-test-step

Conversation

@JonasJesus42
Copy link
Copy Markdown
Contributor

@JonasJesus42 JonasJesus42 commented May 4, 2026

Summary

The changed-MCPs detection in checks.yml used git diff "$BASE" HEAD, which compares the current tip of main against HEAD. So whenever main had moved ahead since the PR forked, every path touched on main showed up as "changed" too — and the Run type check / Run tests steps 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:

  • two-dot (old): .github bun.lock deploy.json discord discord-read dropbox github google-gmail package.json vtex
  • three-dot (new): .github hyperdx scripts

Test plan

  • Verified locally that git diff --name-only origin/main...HEAD returns only the paths this PR touches
  • CI on this PR runs only against .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 current main tip. This prevents unrelated MCP jobs from running when main moves and runs checks only for paths changed by the PR.

Written for commit be1fe7f. Summary will update on new commits.

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>
@JonasJesus42 JonasJesus42 merged commit 315ea6f into main May 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant