From f43d7b21e2c15b274acd42f338369c6ff83103d3 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 4 Apr 2026 22:08:16 +0900 Subject: [PATCH] Accept trailing comma in tool input option --- .github/workflows/release.yml | 2 +- main.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05ae117a..0dd3daa3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: if [[ "${list}" == *","* ]]; then # If a comma is contained, consider it is a comma-separated list. # Drop leading and trailing whitespaces in each element. - sed -E 's/ *, */,/g; s/^.//' <<<",${list}," + sed -E 's/ *, */,/g; s/^.//; s/,,$/,/' <<<",${list}," else # Otherwise, consider it is a whitespace-separated list. # Convert whitespace characters into comma. diff --git a/main.sh b/main.sh index 44f45722..27f98b68 100755 --- a/main.sh +++ b/main.sh @@ -35,7 +35,7 @@ normalize_comma_or_space_separated() { if [[ "${list}" == *","* ]]; then # If a comma is contained, consider it is a comma-separated list. # Drop leading and trailing whitespaces in each element. - sed -E 's/ *, */,/g; s/^.//' <<<",${list}," + sed -E 's/ *, */,/g; s/^.//; s/,,$/,/' <<<",${list}," else # Otherwise, consider it is a whitespace-separated list. # Convert whitespace characters into comma.