feat(entrypoint.sh): support four digit version numbers

This commit is contained in:
2024-06-24 18:19:15 +02:00
committed by GitHub
parent 07a2fe6768
commit d0b126a66e

View File

@@ -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+)?(-[^\'\"\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