From 1cd01898b27db3a616dcd41ace7e9509c17681b5 Mon Sep 17 00:00:00 2001 From: fithwum Date: Wed, 9 Jul 2025 07:43:33 -0700 Subject: [PATCH] fghfdghfdgh --- .gitea/workflows/base-build.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 939c3ea..d1c8ac6 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -190,7 +190,7 @@ jobs: - name: Clone upload repo run: | GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}" - git clone --depth=50 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo + git clone --depth=10 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo - name: Generate per-version changelogs run: | @@ -210,11 +210,19 @@ jobs: echo -e "\n## $(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$changelog" - if [ -n "$last_commit" ] && git rev-parse --quiet --verify "$last_commit^{commit}" >/dev/null; then - git log "${last_commit}..HEAD" --pretty=format:"- %s (%an)" | head -n 10 || true + if [ -n "$last_commit" ]; then + # Check if commit exists in history + if git merge-base --is-ancestor "$last_commit" HEAD 2>/dev/null; then + echo "[INFO] Using commits since $last_commit" + git log "${last_commit}..HEAD" --pretty=format:"- %s (%an)" | head -n 10 >> "$changelog" + else + echo "[WARN] $last_commit not found in current history (likely due to shallow clone)" + git log -n 10 --pretty=format:"- %s (%an)" >> "$changelog" + fi else - git log -n 10 --pretty=format:"- %s (%an)" || true - fi >> "$changelog" + echo "[INFO] No previous commit found in build-info.json" + git log -n 10 --pretty=format:"- %s (%an)" >> "$changelog" + fi done - name: Commit and push changelogs if changed