From a3f5b56b353429491b7dfed2defd1a595a3287a4 Mon Sep 17 00:00:00 2001 From: Jack Baldry Date: Wed, 24 Jan 2024 11:40:51 +0000 Subject: [PATCH] Quote options before adding them to the options array Signed-off-by: Jack Baldry --- update-make-docs/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-make-docs/action.yml b/update-make-docs/action.yml index 7e5290ce9..13e833af0 100644 --- a/update-make-docs/action.yml +++ b/update-make-docs/action.yml @@ -81,7 +81,7 @@ runs: # For example, pr_options: --label 'backport v10.0.x' OPTIONS_ARRAY=() while IFS= read -r -d '' arg; do - OPTIONS_ARRAY+=("$arg") + OPTIONS_ARRAY+=("$(printf "%q" "$arg")") done < <(echo "${PR_OPTIONS}" | xargs printf '%s\0') if ! git diff --exit-code; then @@ -89,6 +89,6 @@ runs: git push origin "refs/heads/${BRANCH}" # Set default options before the user-provided ones as later options appear to override earlier ones. # For example, in `gh pr create --web --title foo --title bar`, the resulting title is "bar". - gh pr create --title 'Update `make docs` procedure' --body '' ${OPTIONS_ARRAY[@]} + gh pr create --title 'Update `make docs` procedure' --body '' "${OPTIONS_ARRAY[@]}" fi shell: bash