Skip to content

fix(ci): detect changed areas from merge-base, not base..head - #81

Merged
loss-and-quick merged 1 commit into
mainfrom
fix/ci-detect-merge-base
Jun 22, 2026
Merged

fix(ci): detect changed areas from merge-base, not base..head#81
loss-and-quick merged 1 commit into
mainfrom
fix/ci-detect-merge-base

Conversation

@loss-and-quick

Copy link
Copy Markdown
Owner

Summary

The changes detect job computed touched areas with a two-dot git diff "$base" "$head". When the PR branch is behind the base (main advanced after the branch forked — the normal case), that diff also lists every file main changed since the fork point, so unrelated PRs spuriously triggered the frontend, desktop-linux, and desktop-windows jobs.

Switched to three-dot git diff "$base...$head", which diffs from the merge-base — matching GitHub's own PR diff semantics. A docs-only PR now flags only the docs area, no Rust/desktop runners spun up.

Concretely: PR #80 (only CHANGELOG.md changed) still ran desktop-linux/desktop-windows because the two-dot diff pulled in i18n/* and a workflow file landed on main after the branch forked.

Affected layer

  • CI / .github/

Verification

Reproduced locally against the PR's base.sha:

  • git diff --name-only base head (two-dot) → CHANGELOG.md plus i18n/*, sync-bun-nix.yml
  • git diff --name-only base...head (three-dot) → CHANGELOG.md only

Three-dot is also correct for push events: when before is an ancestor of the pushed commit, the merge-base is before, so it reduces to the previous behavior.

Checklist

  • Title is a scoped Conventional Commit; commits are logically split
  • No build artifacts committed

A two-dot `git diff base head` also lists files main changed after the
branch forked, so unrelated PRs spuriously triggered the frontend and
desktop (Linux/Windows) jobs. Use three-dot to diff from the merge-base,
matching GitHub's PR diff.
@github-actions github-actions Bot added the ci CI / workflows (.github/) label Jun 22, 2026
@loss-and-quick
loss-and-quick merged commit 9d29f9c into main Jun 22, 2026
8 checks passed
@loss-and-quick
loss-and-quick deleted the fix/ci-detect-merge-base branch June 22, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI / workflows (.github/)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant