Skip to content

Commit

Permalink
fix: [030#88] Quote all labels that have spaces. Otherwise a PR to up…
Browse files Browse the repository at this point in the history
…date the go version cannot be created
  • Loading branch information
sbp-bvanb committed Dec 11, 2024
1 parent 96b1830 commit 6bb2f80
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -120,19 +120,30 @@ 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 }}'"
# fi
# echo "after: ${GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA}"
labels=("${DEPENDENCIES_LABEL}" "${GO_LABEL}" "${GOMOD_GO_VERSION_UPDATER_LABEL}")
if [ -n "${{ inputs.extra-pr-label }}" ]; then
export GOMOD_GO_VERSION_UPDATER_LABEL_EXTRA="--label ${{ inputs.extra-pr-label }}"
labels+=("${{ inputs.extra-pr-label }}")
fi
echo "Labels:"
for label in "${labels[@]}"; do
echo "'$label'"
done
echo "creating pr..."
gh pr create \
--base main \
--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}
$(for label in "${labels[@]}"; do echo "--label \"${label}\""; done)
shell: bash
env:
GH_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 6bb2f80

Please sign in to comment.