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 #27 from aiming/fix-checkout-failure
Browse files Browse the repository at this point in the history
CHECKOUT_FULL_PATHに余分な")"が入っていたので削除
  • Loading branch information
takesato authored Dec 4, 2023
2 parents 73069d2 + d9329e1 commit bb30903
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 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
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ inputs:
default: false
checkout_dir:
description: 'Name of directory to check out'
required: true
default: '.'
depth:
description: 'git clone --depth={} option'
default: ''
Expand Down Expand Up @@ -80,7 +80,7 @@ runs:
https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
${{ inputs.checkout_dir }}
CHECKOUT_FULL_PATH="$(pwd)${{ inputs.checkout_dir }})"
CHECKOUT_FULL_PATH="$(pwd)/${{ inputs.checkout_dir }}"
CHECKOUT_FULL_PATH="$(realpath $CHECKOUT_FULL_PATH)"
if [ $(git config --global --get-all safe.directory | grep -c "${CHECKOUT_FULL_PATH}$") -eq 0 ]; then
/usr/bin/git config --global --add safe.directory "${CHECKOUT_FULL_PATH}"
Expand Down

0 comments on commit bb30903

Please sign in to comment.