Skip to content

Commit

Permalink
Quote options before adding them to the options array
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
  • Loading branch information
jdbaldry committed Jan 24, 2024
1 parent c06ad97 commit a3f5b56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions update-make-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ 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
commit
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

0 comments on commit a3f5b56

Please sign in to comment.