File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 run : apt-get update && apt-get install -y git
2323 - name : Checkout repository
2424 uses : actions/checkout@v4
25+ - name : " Validate version tag doesn't exist"
26+ run : |
27+ VERSION=$(grep '^version=' gradle.properties | cut -d'=' -f2)
28+ TAG="v${VERSION}"
29+ if git ls-remote --tags origin | grep -q "refs/tags/${TAG}$"; then
30+ echo "============================================="
31+ echo "ERROR: Tag ${TAG} already exists!"
32+ echo ""
33+ echo "Please bump the version in gradle.properties"
34+ echo "============================================="
35+ exit 1
36+ fi
37+ echo "✓ Version ${VERSION} is valid (tag ${TAG} does not exist yet)"
2538 - name : " Gradle cache"
2639 uses : actions/cache@v4
2740 with :
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ task tagRelease {
164164 grgit. push(refsOrSpecs : [" v$version " ])
165165 }
166166 catch (RefAlreadyExistsException ignored) {
167- throw new GradleException (" Tag v$version already exists. Bump the version in gradle.properties before tagging again ." )
167+ logger . warn (" Tag v$version already exists." )
168168 }
169169 }
170170}
You can’t perform that action at this time.
0 commit comments