Skip to content

Commit 0a7625b

Browse files
committed
action: fix inputs.global handling
1 parent 6010d27 commit 0a7625b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ runs:
1818
env:
1919
INPUT_BOT: "${{ inputs.bot }}"
2020
INPUT_NAME: "${{ inputs.name || inputs.bot }}"
21+
INPUT_GLOBAL: "${{ inputs.global }}"
2122
SCRIPT: "${{ github.action_path }}/set_bot_user.sh"
2223
run: |
2324
set -euo pipefail
2425
path="https://api.github.com/users/${INPUT_BOT}%5Bbot%5D"
2526
user_id="$(curl -sS "${path}" | jq -r .id)"
27+
args=()
28+
if [[ "${INPUT_GLOBAL}" =~ (true|1) ]]; then
29+
args+=("--global")
30+
fi
2631
set -x
27-
git config ${{ inputs.global && "--global" || "" }} \
32+
git config "${args[@]}" \
2833
user.name "${INPUT_NAME}"
29-
git config ${{ inputs.global && "--global" || "" }} \
34+
git config "${args[@]}" \
3035
user.email "${user_id}+${INPUT_BOT}[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)