Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 1a5d2e2

Browse files
committed
Checkoutのパスが異なるとき、エラーになる現象を修正
1 parent 053499e commit 1a5d2e2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ runs:
8080
https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
8181
${{ inputs.checkout_dir }}
8282
83-
if [ $(git config --global --get-all safe.directory | grep -c "$(pwd)$") -eq 0 ]; then
84-
/usr/bin/git config --global --add safe.directory $(pwd)
83+
CHECKOUT_FULL_PATH="$(pwd)${{ inputs.checkout_dir }})"
84+
CHECKOUT_FULL_PATH="$(realpath $CHECKOUT_FULL_PATH)"
85+
if [ $(git config --global --get-all safe.directory | grep -c "${CHECKOUT_FULL_PATH}$") -eq 0 ]; then
86+
/usr/bin/git config --global --add safe.directory "${CHECKOUT_FULL_PATH}"
8587
fi
8688
8789
pushd ${{ inputs.checkout_dir }}

0 commit comments

Comments
 (0)