diff --git a/.gitea/workflows/maven.yaml b/.gitea/workflows/maven.yaml index 10794e7..bc61388 100644 --- a/.gitea/workflows/maven.yaml +++ b/.gitea/workflows/maven.yaml @@ -206,7 +206,9 @@ jobs: push_branch="" elif [[ $REF_TYPE == tag ]]; then new=${REF_NAME#v} - push_branch=main + # Commit the release version back to main only where main exists (some repos only have develop). + push_branch="" + if git ls-remote --exit-code --heads origin main > /dev/null; then push_branch=main; fi elif [[ $REF_NAME == "$SNAPSHOT_BRANCH" ]]; then new=$current recent=$(git log --oneline -10 --since="3 days ago" \