Skip to content

Commit

Permalink
Merge pull request #8968 from paulbalandan/script-check
Browse files Browse the repository at this point in the history
chore: add checks for RELEASE and VERSION variables
  • Loading branch information
kenjis authored Jun 19, 2024
2 parents 24a7673 + bab2391 commit 71dc065
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/scripts/deploy-userguide
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@
SOURCE=$1
TARGET=$2
RELEASE=$3
VERSION=`echo "$RELEASE" | cut -c 2-`

# Check if RELEASE is empty
if [ -z "$RELEASE" ]; then
echo "Error: \$RELEASE parameter is empty."
exit 1
fi

VERSION=$(echo "$RELEASE" | cut -c 2-)

# Check if VERSION is empty
if [ -z "$VERSION" ]; then
echo "Error: Failed to extract \$VERSION from \$RELEASE parameter '$RELEASE'."
exit 1
fi

# Check if VERSION matches the format X.Y.Z
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: VERSION '$VERSION' does not match the expected format X.Y.Z."
exit 1
fi

echo "Preparing for version $3"
echo "Merging files from $1 to $2"
Expand Down

0 comments on commit 71dc065

Please sign in to comment.