diff --git a/.gitea/workflows/deploy-ci.yaml b/.gitea/workflows/deploy-ci.yaml index 239c69a..8e812af 100644 --- a/.gitea/workflows/deploy-ci.yaml +++ b/.gitea/workflows/deploy-ci.yaml @@ -96,10 +96,20 @@ jobs: git add .gitea/workflows/ci.yml if ! git diff --cached --quiet; then + git fetch --tags >/dev/null 2>&1 latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || true) - if [ -n "$latest_tag" ] && [ "$latest_tag" != "v1.0.0" ]; then - git push origin --delete tag "$latest_tag" >/dev/null 2>&1 || true - git tag -d "$latest_tag" >/dev/null 2>&1 || true + latest_tag=$(echo "$latest_tag" | xargs) + echo "Latest tag detected: '$latest_tag'" + if [ -n "$latest_tag" ]; then + if [ "$latest_tag" = "v1.0.0" ]; then + echo "Never delete v1.0.0" + else + echo "Deleting tag '$latest_tag' (not v1.0.0)..." + git push origin --delete tag "$latest_tag" >/dev/null 2>&1 || true + git tag -d "$latest_tag" >/dev/null 2>&1 || true + fi + else + echo "No tags found to consider for deletion." fi git commit -m "Update CI" --quiet git push origin HEAD:main --tags --force >/dev/null 2>&1 @@ -116,7 +126,6 @@ jobs: done < "$valid_repos_file" rm "$valid_repos_file" - rm -rf "$tmpdir" echo " ✓ Completed $owner/$repo"