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

Commit

Permalink
safe.directoryをチェックするテストケースを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasuya-aim committed Dec 1, 2023
1 parent c536e34 commit 9c3bcc9
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ jobs:
uses: ./
with:
depth: ''
checkout_dir: step.authoer
checkout_dir: step.author

- name: Have user.name and user.email on .git/config?
run: |
set -xe
pwd
ls -al
pushd step.authoer
pushd step.author
if [ "${GITHUB_ACTOR}" != "$(git config --local --get user.name)" ]; then
echo '::error:: "git config --local --get user.name" Should be equal' "$GITHUB_ACTOR"
exit 1
Expand Down Expand Up @@ -154,6 +154,32 @@ jobs:
exit 1
fi
- name: Test Write checkout dir to safe.dirctory on .gitconfig
uses: ./
with:
depth: ''
checkout_dir: step.checkout-dir

- name: Have a current directory in safe.directory on .gitconfig
run: |
set -xe
pwd
SAFE_DIRECTORIES=$(git config --get-all safe.directory)
EXPECT="$(pwd)/step.checkout-dir"
FOUND=false
for s in $SAFE_DIRECTORIES; do
if [ "$s" = "$EXPECT" ]; then
FOUND=true
fi
done
if [ "$FOUND" = 'false' ]; then
echo "::error:: safe.directory内に $EXPECT が見つかりません"
echo "$SAFE_DIRECTORIES"
exit 1
fi
- name: Setup github.com connection
continue-on-error: true
run: |
Expand Down

0 comments on commit 9c3bcc9

Please sign in to comment.