Skip to content

Commit 9aee76b

Browse files
ci(coverage): drop --depth=1 on the base fetch — fix diff-cover 'no merge base' (#206)
The patch-coverage gate did 'git fetch origin <base> --depth=1', truncating the base to one commit with no common ancestor with the PR branch whenever the branch was behind base — so diff-cover crashed with 'fatal: origin/<base>...HEAD: no merge base' and reded coverage on PRs that were merely stale (hit repeatedly). The checkout is already fetch-depth:0, so a plain 'git fetch origin <base>' resolves the merge-base reliably. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6ce63a3 commit 9aee76b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/coverage.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
- name: Patch coverage gate (100% of changed lines)
5050
if: github.event_name == 'pull_request'
5151
run: |
52-
git fetch origin "${{ github.base_ref }}" --depth=1 || true
52+
# Full base history (NOT --depth=1): a shallow base fetch shares no merge-base
53+
# with a PR branch that is behind base → diff-cover "no merge base" crash.
54+
git fetch origin "${{ github.base_ref }}" || true
5355
diff-cover coverage/lcov.info \
5456
--compare-branch="origin/${{ github.base_ref }}" \
5557
--fail-under=100

0 commit comments

Comments
 (0)