diff --git a/action.yml b/action.yml index a58aaed..77ad98f 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ inputs: required: false protocPlugins: description: The protoc language plugins to install, space separated. See README for supported plugins. - default: " " + default: "none" required: false runs: diff --git a/scripts/install-buf.sh b/scripts/install-buf.sh index 10143bf..955d5f2 100755 --- a/scripts/install-buf.sh +++ b/scripts/install-buf.sh @@ -5,17 +5,19 @@ source scripts/executor-info.sh BUF_VERSION=$1 -IFS=" " read -r -a PROTOC_PLUGINS <<< "$2" -for part in "${PROTOC_PLUGINS[@]}"; do - IFS="@" read -r -a langAndVersion <<< "$part" +if [ "$2" != "none" ]; then + IFS=" " read -r -a PROTOC_PLUGINS <<<"$2" + for part in "${PROTOC_PLUGINS[@]}"; do + IFS="@" read -r -a langAndVersion <<<"$part" - if [ "${#langAndVersion[@]}" != 2 ]; then - echo "Malformed plugin specifier \"$part\", expected e.g. go@v1.25.0" - exit 1 - fi + if [ "${#langAndVersion[@]}" != 2 ]; then + echo "Malformed plugin specifier \"$part\", expected e.g. go@v1.25.0" + exit 1 + fi - bash "scripts/install-${langAndVersion[0]}-plugin.sh" "${langAndVersion[1]}" -done + bash "scripts/install-${langAndVersion[0]}-plugin.sh" "${langAndVersion[1]}" + done +fi if [ ! -f ".bin/buf" ]; then echo "Installing buf $BUF_VERSION for OS $UNAME_OS Arch $UNAME_ARCH"