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

Commit 9c3bcc9

Browse files
committed
safe.directoryをチェックするテストケースを追加
1 parent c536e34 commit 9c3bcc9

1 file changed

Lines changed: 28 additions & 2 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: |

0 commit comments

Comments
 (0)