Skip to content

Commit 9c89436

Browse files
edburnsCopilot
andauthored
Validate RELEASE_VERSION format.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 1df2f95 commit 9c89436

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/publish-maven.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ jobs:
8282
DEV_VERSION="${{ inputs.developmentVersion }}"
8383
else
8484
# Split version: supports both "0.1.32" and "0.1.32-java.0" formats
85+
# Validate RELEASE_VERSION format explicitly to provide clear errors
86+
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-java\.[0-9]+)?$'; then
87+
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P or M.M.P-java.N (e.g., 1.2.3 or 1.2.3-java.0)." >&2
88+
exit 1
89+
fi
8590
# Extract the base M.M.P portion (before any qualifier)
8691
BASE_VERSION=$(echo "$RELEASE_VERSION" | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
8792
QUALIFIER=$(echo "$RELEASE_VERSION" | sed "s|^${BASE_VERSION}||")

0 commit comments

Comments
 (0)