ci: check a pull request against the base it merges into
Package
None, this changes CI only.
Changes
Lint's Check versions and Check one package per pull request steps diffed the checkout against github.event.pull_request.base.sha. The checkout is the pull request merged into the base branch, but base.sha can be an older commit. When a pull request is behind main, main's newer commits then count as part of the pull request.
#72 hit this. Its branch started at f76309e, main had since merged #64, and Lint failed with This pull request changes 2 packages: dev-servers, openvpn-connect although #72 only touches dev-servers.
Both steps now pass HEAD^1, the merge commit's first parent, which is the base the pull request merges into. The version check also reads earlier versions from that base, so it compares against everything main has published, not only what was there when the branch started.
Access
None.
Testing
- Checked out #72's merge commit
0322c4e(parents9e736a4and3fa9d69), the one CI ran on../scripts/check-one-package.sh f76309ereproduces the failure../scripts/check-one-package.sh HEAD^1and./scripts/check-versions.sh HEAD^1pass. - Merged a change to
dev-serversthat keeps version 1.0.2 intomainwith--no-ff../scripts/check-versions.sh HEAD^1still fails withpackages/dev-servers changed but is still version 1.0.2. actionlintpasses onci.yml.- Merges cleanly with #78, which also changes
ci.yml.
Claude Opus 5.5 via Claude Code
Summary by cubic
Fixes the CI version and one-package checks so they diff against the base the pull request actually merges into instead of base.sha, which can be older and caused main's newer commits to count as part of the pull request.
- Both lint steps now pass
HEAD^1, the merge commit's first parent, which is the base branch the pull request merges into. - The version check also reads previously published versions from that base, so it compares against everything main has published, not only what existed when the branch started.
Summary by CodeRabbit
- Chores
- Pull-request checks for version and package-count changes now compare against the pull request’s base commit, helping ensure their results reflect the correct changes. This update affects automated validation only; it does not change the application’s features or behavior.