From 1ff82cb500079c2313a751289d84b471cbdb9cf3 Mon Sep 17 00:00:00 2001 From: sbp-bvanb Date: Wed, 11 Dec 2024 08:06:41 +0100 Subject: [PATCH] fix: [#88] Quote all labels that have spaces. Otherwise a PR to update the go version cannot be created --- action.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index e8abc1a..5842a42 100644 --- a/action.yml +++ b/action.yml @@ -53,17 +53,17 @@ runs: fi } if ! check_label_exists ${DEPENDENCIES_LABEL}; then - gh label create ${DEPENDENCIES_LABEL} \ + gh label create "${DEPENDENCIES_LABEL}" \ --color "#0366d6" \ --description "Pull requests that update a dependency file" fi if ! check_label_exists ${GO_LABEL}; then - gh label create ${GO_LABEL} \ + gh label create "${GO_LABEL}" \ --color "#16e2e2" \ --description "Pull requests that update Go code" fi if ! check_label_exists ${GOMOD_GO_VERSION_UPDATER_LABEL}; then - gh label create ${GOMOD_GO_VERSION_UPDATER_LABEL} \ + gh label create "${GOMOD_GO_VERSION_UPDATER_LABEL}" \ --color "#F50BAB" \ --description "Pull requests that update Go version in the go.mod file" fi @@ -120,9 +120,11 @@ runs: exit 0 fi + echo "before: ${{ inputs.extra-pr-label }}" if [ -n "${{ inputs.extra-pr-label }}" ]; then - export GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA="--label ${{ inputs.extra-pr-label }}" + export GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA="--label '${{ inputs.extra-pr-label }}'" fi + echo "after: ${GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA}" echo "creating pr..." gh pr create \ @@ -130,9 +132,9 @@ runs: --body "${GOMOD_GO_VERSION_UPDATER_ACTION_MESSAGE}" \ --fill \ --head "${GOMOD_GO_VERSION_UPDATER_ACTION_BRANCH}" \ - --label ${DEPENDENCIES_LABEL} \ - --label ${GO_LABEL} \ - --label ${GOMOD_GO_VERSION_UPDATER_LABEL} ${GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA} + --label "${DEPENDENCIES_LABEL}" \ + --label "${GO_LABEL}" \ + --label "${GOMOD_GO_VERSION_UPDATER_LABEL}" ${GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA} shell: bash env: GH_TOKEN: ${{ github.token }}