Skip to content

Commit 8f36e74

Browse files
committed
Verify release tag exists
1 parent efba580 commit 8f36e74

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/publish-release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ jobs:
4040
cache: 'maven'
4141
- name: Determine Version
4242
id: version
43+
env:
44+
REF: ${{ github.event.workflow_run.head_branch }}
4345
run: |
46+
if ! git show-ref --exists "refs/tags/$REF"; then
47+
echo "::error ::Tag $REF does not exist, aborting."
48+
exit 1
49+
fi
50+
4451
VERSION=$(./mvnw --batch-mode --no-transfer-progress help:evaluate -Dexpression=project.version -q -DforceStdout)
4552
echo "Determined VERSION=$VERSION"
4653
if [[ "$VERSION" = *-SNAPSHOT ]]; then

0 commit comments

Comments
 (0)