fix(ci): detect changed areas from merge-base, not base..head - #81
Merged
Conversation
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.
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
changesdetect job computed touched areas with a two-dotgit 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 thefrontend,desktop-linux, anddesktop-windowsjobs.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.mdchanged) still randesktop-linux/desktop-windowsbecause the two-dot diff pulled ini18n/*and a workflow file landed on main after the branch forked.Affected layer
.github/Verification
Reproduced locally against the PR's
base.sha:git diff --name-only base head(two-dot) →CHANGELOG.mdplusi18n/*,sync-bun-nix.ymlgit diff --name-only base...head(three-dot) →CHANGELOG.mdonlyThree-dot is also correct for
pushevents: whenbeforeis an ancestor of the pushed commit, the merge-base isbefore, so it reduces to the previous behavior.Checklist