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

Commit 90091d7

Browse files
authored
Merge pull request #18 from aiming/kasuya/ignore-add-safe-directory-if-it-exists
safe.directoryが複数同じものが登録されないようにした
2 parents 743e977 + 59623dc commit 90091d7

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v3
1515

16+
- name: Check .gitconfig
17+
run: |
18+
if [ -f ~/.gitconfig ]; then
19+
cat ~/.gitconfig
20+
fi
21+
1622
- name: Test default checkout
1723
uses: ./
1824
with:
@@ -100,3 +106,7 @@ jobs:
100106
exit 1
101107
fi
102108
popd
109+
110+
- name: Check .gitconfig
111+
run: |
112+
cat ~/.gitconfig

action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ runs:
6767
https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
6868
${{ inputs.checkout_dir }}
6969
70-
/usr/bin/git config --global --add safe.directory $(pwd)
70+
if [ $(git config --global --get-all safe.directory | grep -c "$(pwd)$") -eq 0 ]; then
71+
/usr/bin/git config --global --add safe.directory $(pwd)
72+
fi
7173
7274
pushd ${{ inputs.checkout_dir }}
7375
if [ ! -z "$__BRANCH" ]; then

0 commit comments

Comments
 (0)