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

Commit

Permalink
Merge pull request #18 from aiming/kasuya/ignore-add-safe-directory-i…
Browse files Browse the repository at this point in the history
…f-it-exists

safe.directoryが複数同じものが登録されないようにした
  • Loading branch information
takesato authored Jun 5, 2023
2 parents 743e977 + 59623dc commit 90091d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Check .gitconfig
run: |
if [ -f ~/.gitconfig ]; then
cat ~/.gitconfig
fi
- name: Test default checkout
uses: ./
with:
Expand Down Expand Up @@ -100,3 +106,7 @@ jobs:
exit 1
fi
popd
- name: Check .gitconfig
run: |
cat ~/.gitconfig
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ runs:
https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
${{ inputs.checkout_dir }}
/usr/bin/git config --global --add safe.directory $(pwd)
if [ $(git config --global --get-all safe.directory | grep -c "$(pwd)$") -eq 0 ]; then
/usr/bin/git config --global --add safe.directory $(pwd)
fi
pushd ${{ inputs.checkout_dir }}
if [ ! -z "$__BRANCH" ]; then
Expand Down

0 comments on commit 90091d7

Please sign in to comment.