@@ -212,11 +212,9 @@ jobs:
212212 run : |
213213 git status
214214
215- IS_SHALLOW=$(git rev-parse --is-shallow-repository)
216- if [ "$IS_SHALLOW" = "true" ]; then
217- echo "Repository is shallow"
218- else
219- echo "Repository is not shallow"
215+ if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
216+ echo "Repository is shallow, fetching full history..."
217+ git fetch --unshallow
220218 fi
221219
222220 git checkout "${{ env.RELEASE_BRANCH }}"
@@ -226,6 +224,23 @@ jobs:
226224 git push origin "$BRANCH_NAME" --tags
227225 echo "Branch created: $BRANCH_NAME from ${{ env.RELEASE_BRANCH }} branch"
228226 echo "branch_name=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
227+
228+ # Check if the tags are ancestors of the original head
229+ ORIGINAL_HEAD=$(cat /tmp/release_head_sha)
230+ jq -c '.[]' /tmp/commits-by-crate.json | while read -r crate; do
231+ TAG=$(echo "$crate" | jq -r '.tag')
232+ echo "Tag: $TAG"
233+ if git merge-base --is-ancestor "$TAG" "$ORIGINAL_HEAD" 2>/dev/null; then
234+ echo " Tag is ancestor of HEAD, using $ORIGINAL_HEAD"
235+ else
236+ MERGE_BASE=$(git merge-base "$TAG" "$ORIGINAL_HEAD" 2>/dev/null || echo "")
237+ if [ -n "$MERGE_BASE" ]; then
238+ echo " Tag is NOT ancestor of HEAD, using merge-base: $MERGE_BASE"
239+ else
240+ echo " WARNING: Could not find merge-base, using $ORIGINAL_HEAD"
241+ fi
242+ fi
243+ done
229244
230245 - name : Release version bumps
231246 id : release-version-bumps
@@ -272,14 +287,14 @@ jobs:
272287 echo "Using $RANGE as range"
273288
274289 if git merge-base --is-ancestor "$TAG" "$ORIGINAL_HEAD" 2>/dev/null; then
275- echo " Tag is ancestor of HEAD, using $RANGE"
290+ echo " Tag $TAGis ancestor of HEAD, using $RANGE"
276291 else
277292 MERGE_BASE=$(git merge-base "$TAG" "$ORIGINAL_HEAD" 2>/dev/null || echo "")
278293 if [ -n "$MERGE_BASE" ]; then
279294 RANGE="$MERGE_BASE..$ORIGINAL_HEAD"
280- echo " Tag is NOT ancestor of HEAD, using merge-base: $RANGE"
295+ echo " Tag $TAG is NOT ancestor of HEAD, using merge-base: $RANGE"
281296 else
282- echo " WARNING: Could not find merge-base, using $RANGE"
297+ echo " WARNING: Could not find merge-base for tag $TAG , using $RANGE"
283298 fi
284299 fi
285300
0 commit comments