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

Commit bb30903

Browse files
authored
Merge pull request #27 from aiming/fix-checkout-failure
CHECKOUT_FULL_PATHに余分な")"が入っていたので削除
2 parents 73069d2 + d9329e1 commit bb30903

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ jobs:
103103
uses: ./
104104
with:
105105
depth: ''
106-
checkout_dir: step.authoer
106+
checkout_dir: step.author
107107

108108
- name: Have user.name and user.email on .git/config?
109109
run: |
110110
set -xe
111111
pwd
112112
ls -al
113-
pushd step.authoer
113+
pushd step.author
114114
if [ "${GITHUB_ACTOR}" != "$(git config --local --get user.name)" ]; then
115115
echo '::error:: "git config --local --get user.name" Should be equal' "$GITHUB_ACTOR"
116116
exit 1
@@ -154,6 +154,32 @@ jobs:
154154
exit 1
155155
fi
156156
157+
- name: Test Write checkout dir to safe.dirctory on .gitconfig
158+
uses: ./
159+
with:
160+
depth: ''
161+
checkout_dir: step.checkout-dir
162+
163+
- name: Have a current directory in safe.directory on .gitconfig
164+
run: |
165+
set -xe
166+
pwd
167+
SAFE_DIRECTORIES=$(git config --get-all safe.directory)
168+
EXPECT="$(pwd)/step.checkout-dir"
169+
170+
FOUND=false
171+
for s in $SAFE_DIRECTORIES; do
172+
if [ "$s" = "$EXPECT" ]; then
173+
FOUND=true
174+
fi
175+
done
176+
177+
if [ "$FOUND" = 'false' ]; then
178+
echo "::error:: safe.directory内に $EXPECT が見つかりません"
179+
echo "$SAFE_DIRECTORIES"
180+
exit 1
181+
fi
182+
157183
- name: Setup github.com connection
158184
continue-on-error: true
159185
run: |

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ inputs:
2727
default: false
2828
checkout_dir:
2929
description: 'Name of directory to check out'
30-
required: true
30+
default: '.'
3131
depth:
3232
description: 'git clone --depth={} option'
3333
default: ''
@@ -80,7 +80,7 @@ runs:
8080
https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
8181
${{ inputs.checkout_dir }}
8282
83-
CHECKOUT_FULL_PATH="$(pwd)${{ inputs.checkout_dir }})"
83+
CHECKOUT_FULL_PATH="$(pwd)/${{ inputs.checkout_dir }}"
8484
CHECKOUT_FULL_PATH="$(realpath $CHECKOUT_FULL_PATH)"
8585
if [ $(git config --global --get-all safe.directory | grep -c "${CHECKOUT_FULL_PATH}$") -eq 0 ]; then
8686
/usr/bin/git config --global --add safe.directory "${CHECKOUT_FULL_PATH}"

0 commit comments

Comments
 (0)