Skip to content

Commit 353030f

Browse files
committed
ci: fix extension-scan merge-base failure on shallow clones
The scan job fetched the base branch with --depth=1 and used a three-dot git diff, which fails with 'no merge base' because the shallow base and PR head share no common ancestor. Use fetch-depth: 0 so the diff resolves. Affected every registry-PR listing.
1 parent ac36ba4 commit 353030f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/extension-scan.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
# Full history so the three-dot diff below has a merge base with the
24+
# base branch (a shallow --depth=1 fetch leaves them with no common
25+
# ancestor: "fatal: origin/<base>...HEAD: no merge base").
26+
fetch-depth: 0
2227

2328
- name: Find changed listings
2429
id: changed
2530
run: |
26-
git fetch origin "${{ github.base_ref }}" --depth=1
27-
files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD -- 'apps/extensions/registry/**/listing.json')
31+
git fetch origin "${{ github.base_ref }}"
32+
files=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" -- 'apps/extensions/registry/**/listing.json')
2833
echo "files<<EOF" >> "$GITHUB_OUTPUT"
2934
echo "$files" >> "$GITHUB_OUTPUT"
3035
echo "EOF" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)