Skip to content

Commit cdf5aa2

Browse files
committed
Use array for PR options
1 parent 68c139a commit cdf5aa2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/validate-plugin-version.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,17 @@ main() {
146146
BASE_BRANCH="${BRANCH:-$DEFAULT_BRANCH}"
147147

148148
echo "Creating a pull request with base branch $BASE_BRANCH."
149-
local PR_OPTIONS="--title \"Update Tested Up To version to $CURRENT_WP_VERSION\" --body \"This pull request updates the 'Tested up to' version in specified files (${FILENAMES}) to match the current WordPress version $CURRENT_WP_VERSION.\" --base \"$BASE_BRANCH\""
149+
PR_OPTIONS=(
150+
--title "Update Tested Up To version to $CURRENT_WP_VERSION"
151+
--body "This pull request updates the 'Tested up to' version in specified files (${FILENAMES}) to match the current WordPress version $CURRENT_WP_VERSION."
152+
--base "$BASE_BRANCH"
153+
)
154+
150155
if [[ "${PR_STATUS:-}" != "open" ]]; then
151-
PR_OPTIONS="${PR_OPTIONS} --draft"
156+
PR_OPTIONS+=(--draft)
152157
fi
153158

154-
NEW_PR_URL=$(gh pr create "$PR_OPTIONS")
159+
NEW_PR_URL=$(gh pr create "${PR_OPTIONS[@]}")
155160

156161
local PREFIX_MATCHES
157162
PREFIX_MATCHES=$(echo "$OPEN_PRS" | jq -r --arg prefix "$BRANCH_PREFIX" '.[] | select(.headRefName | startswith($prefix)) | "\(.number) \(.headRefName)"')

0 commit comments

Comments
 (0)