Quellcode durchsuchen

ci(managers): clone all tags + full history for every flavor

upstream checkout@v7 uses fetch-depth:0 + fetch-tags so
manager build.gradle.kts can run git describe --tags --long
and rev-list --count on all branches without shallow gaps
(pershoot hit :78 toInt("") without it); fetch
+refs/heads/* + +refs/tags/* for every repo.
TheWildJames vor 1 Woche
Ursprung
Commit
af7a3d9490
1 geänderte Dateien mit 6 neuen und 14 gelöschten Zeilen
  1. 6 14
      .github/workflows/managers.yml

+ 6 - 14
.github/workflows/managers.yml

@@ -489,25 +489,17 @@ jobs:
           flavor="${{ matrix.flavor }}"
           dir="/tmp/$flavor-src"
           rm -rf "$dir"
-          # Mirror upstream checkout@v7 fetch-depth: 0 — pershoot manager build.gradle.kts
-          # does `git describe --tags --long` + `rev-list --count` so shallow breaks at :78 toInt("")
-          git clone --no-checkout --filter=blob:none "$repo" "$dir"
-          # fetch tags + full history for this branch so describe/count work
-          git -C "$dir" fetch --prune --tags --force origin "+refs/heads/${{ matrix.ref }}:refs/remotes/origin/${{ matrix.ref }}" 2>&1 | tail -5 || true
-          git -C "$dir" fetch --depth=1 origin "$sha" 2>&1 | tail -5 || true
-          # ensure tags are present even if shallow
-          git -C "$dir" fetch --tags --depth=50 origin 2>&1 | tail -5 || true
+          # Mirror upstream checkout@v7 fetch-depth: 0 with all tags
+          # All 4 managers use git describe --tags --long / rev-list --count
+          git clone --no-checkout "$repo" "$dir"
+          # fetch all branches + all tags, full history (faithful to upstream)
+          git -C "$dir" fetch --prune --tags --force origin "+refs/heads/*:refs/remotes/origin/*" "+refs/tags/*:refs/tags/*" 2>&1 | tail -5 || true
           git -C "$dir" checkout --detach "$sha"
-          # if still no tags, unshallow
-          if ! git -C "$dir" describe --tags --long HEAD >/dev/null 2>&1; then
-            echo "No tags after shallow fetch — unshallowing"
-            git -C "$dir" fetch --unshallow --tags 2>&1 | tail -10 || true
-          fi
           actual=$(git -C "$dir" rev-parse HEAD)
           if [[ "$actual" != "$sha" ]]; then
             echo "Commit mismatch: expected $sha got $actual" >&2; exit 1
           fi
-          echo "Cloned $flavor at $actual (describe: $(git -C "$dir" describe --tags --long HEAD 2>&1 | head -1))"
+          echo "Cloned $flavor at $actual (describe: $(git -C "$dir" describe --tags --long HEAD 2>&1 | head -1) count: $(git -C "$dir" rev-list --count HEAD 2>&1 | head -1) tags: $(git -C "$dir" tag | wc -l))"
           echo "SRC_DIR=$dir" >> "$GITHUB_ENV"
 
       # ── Stock build requirements per upstream — no edits except key ──