From 586c520164fa4a806e664da859a32c67ed905a1e Mon Sep 17 00:00:00 2001 From: Carlos Garate Date: Tue, 28 Nov 2023 10:47:48 -0500 Subject: [PATCH] docs: fix jq example `<<<` appends a new line, which makes readline add an empty string to the array Details here: https://stackoverflow.com/a/64093036 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f4401bf..f12418b6 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ Consider using one of the other formats if that's the case. with: format: 'json' - run: | - readarray -t removed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.removed }}')" - for removed_file in ${removed_files[@]}; do + readarray -t removed_files < <(jq -r '.[]' <<<'${{ steps.files.outputs.removed }}') + for removed_file in "${removed_files[@]}"; do echo "Do something with this ${removed_file}." done ```