Fix main.sh: bail on semver operators (#26)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU
2022-10-03 23:02:42 +11:00
committed by GitHub
parent e85ee51dd0
commit 9f3710a281

View File

@@ -164,6 +164,9 @@ fi
for tool in "${tools[@]}"; do
if [[ "${tool}" == *"@"* ]]; then
version="${tool#*@}"
if [[ ! "${version}" =~ ^([1-9][0-9]*(\.[0-9]+(\.[0-9]+)?)?|0\.[1-9][0-9]*(\.[0-9]+)?|^0\.0\.[0-9]+)(-[0-9A-Za-z\.-]+)?(\+[0-9A-Za-z\.-]+)?$|^latest$ ]]; then
bail "takie-e/install-action does not support semver operators"
fi
else
version="latest"
fi