Skip to content

ci(guard): find the merge base on a shallow checkout and fail closed when it cannot - #359

Merged
Chris-Wolfgang merged 1 commit into
mainfrom
ci/guard-merge-base
Sep 19, 2026
Merged

Chris-Wolfgang merged 1 commit into
mainfrom
ci/guard-merge-base

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Fleet copy of Chris-Wolfgang/repo-template#584's guard fix. The first live run of the new guard (repo-template#582) passed a PR that changed pr.yaml: the detect-projects checkout is depth 1, so main-branch...HEAD had no merge base, the diff failed silently and the guard reported "no protected configuration files changed" — i.e. on main right now the guard passes everything. This deepens the PR head until a merge base exists (token-authenticated, so private repos work), diffs against it explicitly, and fails closed with ::error:: if none can be found.

Config-only PR. It runs under main's currently-open guard, so it merges normally with the ruleset active; the first config-only PR after it is the real proof.

🤖 Generated with Claude Code

…when it cannot

repo-template#584: the detect job's checkout is depth 1, so the guard's
three-dot diff had no merge base, failed silently and reported "no protected
configuration files changed" for every PR. Deepen the PR head until a merge
base exists, diff against it explicitly, and error out if none can be found.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 19, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Chris-Wolfgang
Chris-Wolfgang merged commit 39c0353 into main Sep 19, 2026
17 checks passed
@Chris-Wolfgang
Chris-Wolfgang deleted the ci/guard-merge-base branch September 19, 2026 18:18
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.

2 participants