feat(dedup): added support for four digit versions
Some checks failed
Docker Image CI / build (push) Waiting to run
release / release (push) Waiting to run
release / release-check (push) Waiting to run
reviewdog / runner / shellcheck (push) Waiting to run
reviewdog / runner / hadolint (push) Waiting to run
Test / test (push) Waiting to run
Test / needless_prefix (push) Waiting to run
Test / not_semver (push) Waiting to run
Test / quoted_version (push) Waiting to run
Test / tagged_version (push) Waiting to run
depup / reviewdog (push) Has been cancelled
depup / redpen (push) Has been cancelled
depup / themis (push) Has been cancelled
Some checks failed
Docker Image CI / build (push) Waiting to run
release / release (push) Waiting to run
release / release-check (push) Waiting to run
reviewdog / runner / shellcheck (push) Waiting to run
reviewdog / runner / hadolint (push) Waiting to run
Test / test (push) Waiting to run
Test / needless_prefix (push) Waiting to run
Test / not_semver (push) Waiting to run
Test / quoted_version (push) Waiting to run
Test / tagged_version (push) Waiting to run
depup / reviewdog (push) Has been cancelled
depup / redpen (push) Has been cancelled
depup / themis (push) Has been cancelled
This commit is contained in:
@@ -11,7 +11,7 @@ VERSION_NAME="${INPUT_VERSION_NAME:-REVIEWDOG_VERSION}"
|
||||
|
||||
# Get current version.
|
||||
# NOTE: Go to https://regex101.com/r/t1JcmL/13 To see the current regex in action.
|
||||
CURRENT_VERSION=$(grep -oP "${VERSION_NAME}(?:\s*=\s*|:?\s*)[\"|\']?v?\K\d+\.\d+\.\d+\.\d+\.?(-[^\'\"\s]*)?" "${FILE}" | head -n1)
|
||||
CURRENT_VERSION=$(grep -oP "${VERSION_NAME}(?:\s*=\s*|:?\s*)[\"|\']?v?\K\d+\.\d+(\.\d+)(\.\d+)?(-[^\'\"\s]*)?" "${FILE}" | head -n1)
|
||||
if [ -z "${CURRENT_VERSION}" ]; then
|
||||
echo "cannot parse ${VERSION_NAME}"
|
||||
exit 1
|
||||
@@ -71,6 +71,6 @@ if [ "${CURRENT_VERSION}" = "${LATEST_VERSION}" ]; then
|
||||
fi
|
||||
|
||||
echo "Updating ${VERSION_NAME} to ${LATEST_VERSION} in ${FILE}"
|
||||
perl -i -pe "s/${VERSION_NAME}(?:\s*=\s*|:?\s*)[\"|\']?v?\K\d+\.\d+\.\d+\.\d+\.?(-[^\'\"\s]*)?/${LATEST_VERSION}/g" "${FILE}"
|
||||
perl -i -pe "s/${VERSION_NAME}(?:\s*=\s*|:?\s*)[\"|\']?v?\K\d+\.\d+(\.\d+)(\.\d+)?(-[^\'\"\s]*)?/${LATEST_VERSION}/g" "${FILE}"
|
||||
|
||||
echo "Updated. Commit and create Pull-Request as you need."
|
||||
|
||||
Reference in New Issue
Block a user