From 9f3710a281934a07c6a95a9dbac65dcc37b31101 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 3 Oct 2022 23:02:42 +1100 Subject: [PATCH] Fix `main.sh`: bail on semver operators (#26) Signed-off-by: Jiahao XU --- main.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.sh b/main.sh index c1f69ba0..b1d4c964 100755 --- a/main.sh +++ b/main.sh @@ -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