Skip to content
Snippets Groups Projects
Commit 59453528 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: insert version tag for docker only if it’s a semver

parent 04d47b5e
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,13 @@ IFS=: read DOCKER_REPO CACHE_TAG <<< $IMAGE_NAME ...@@ -9,6 +9,13 @@ IFS=: read DOCKER_REPO CACHE_TAG <<< $IMAGE_NAME
echo "repo=${DOCKER_REPO}" echo "repo=${DOCKER_REPO}"
echo "tag=${CACHE_TAG}" echo "tag=${CACHE_TAG}"
SEMVER_REGEX="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$"
if ! [[ "$CACHE_TAG" =~ $SEMVER_REGEX ]]; then
echo Not a semver tag - skipping
exit
fi
# Write the tag to package.json>version so that "renovate --version" is correct # Write the tag to package.json>version so that "renovate --version" is correct
sed -i.bak "s/0.0.0-semantic-release/${CACHE_TAG}/" package.json sed -i.bak "s/0.0.0-semantic-release/${CACHE_TAG}/" package.json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment