From b422bf8932e6f3238cf6b6d1143eef630c15d742 Mon Sep 17 00:00:00 2001 From: corporateuser <87529059+corporateuser@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:18:06 +0200 Subject: [PATCH 1/2] Update action.yml fix: do not fail command if grep has not found any version --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ba25a5b..0b7d8db 100644 --- a/action.yml +++ b/action.yml @@ -29,7 +29,7 @@ runs: len=`echo $INPUT_PM | wc -c` if [ $len -gt 1 ]; then PACKAGE_MANAGER=$(echo "$INPUT_PM" | grep -o '^[^@]*') - VERSION=$(echo "$INPUT_PM" | grep -o '@.*' | sed 's/^@//') + VERSION=$(echo "$INPUT_PM" | grep -o '@.*' || true | sed 's/^@//') # Set default VERSION if not provided if [ -z "$VERSION" ]; then VERSION="latest" From 32c14c563983b2853000bfc64adfcf771543d229 Mon Sep 17 00:00:00 2001 From: corporateuser <87529059+corporateuser@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:49:03 +0200 Subject: [PATCH 2/2] Update action.yml Fix: proper grouping for grep --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0b7d8db..970cb48 100644 --- a/action.yml +++ b/action.yml @@ -29,7 +29,7 @@ runs: len=`echo $INPUT_PM | wc -c` if [ $len -gt 1 ]; then PACKAGE_MANAGER=$(echo "$INPUT_PM" | grep -o '^[^@]*') - VERSION=$(echo "$INPUT_PM" | grep -o '@.*' || true | sed 's/^@//') + VERSION=$(echo "$INPUT_PM" | { grep -o '@.*' || true; } | sed 's/^@//') # Set default VERSION if not provided if [ -z "$VERSION" ]; then VERSION="latest"