Skip to content

Commit 77a5579

Browse files
gnodetclaude
andcommitted
ci: deepen PR branch history for Scalpel merge-base detection
The checkout at depth=1 means the merge base between the PR and the base branch is unreachable. Add git fetch --deepen=200 to make the PR branch history available alongside the base branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1bee76d commit 77a5579

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/pr-build-main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ jobs:
8080
- name: Fetch base branch for Scalpel change detection
8181
if: ${{ !inputs.skip_full_build }}
8282
run: |
83-
# Scalpel needs the base branch to detect changes.
84-
# git CLI handles shallow clones reliably (JGit's fetchSubmodules does not).
83+
# Scalpel needs the merge base between HEAD and the base branch.
84+
# The checkout is depth=1, so deepen both sides for merge-base reachability.
85+
git fetch --deepen=200 2>/dev/null || true
8586
git fetch --no-tags --depth=200 origin "${GITHUB_BASE_REF:-main}:refs/remotes/origin/${GITHUB_BASE_REF:-main}"
8687
- id: install-packages
8788
uses: ./.github/actions/install-packages

.github/workflows/sonar-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4646
- name: Fetch base branch for Scalpel change detection
4747
run: |
48+
git fetch --deepen=200 2>/dev/null || true
4849
git fetch --no-tags --depth=200 origin "${GITHUB_BASE_REF:-main}:refs/remotes/origin/${GITHUB_BASE_REF:-main}"
4950
- id: install-packages
5051
uses: ./.github/actions/install-packages

0 commit comments

Comments
 (0)