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 #26 from aiming/debug-option
Browse files Browse the repository at this point in the history
checkout_dir 指定時にエラーになる現象の修正
  • Loading branch information
takesato authored Nov 15, 2023
2 parents 0857ffa + 4e65c75 commit 73069d2
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inputs:
description: 'Clone with fetching LFS .'
default: false
checkout_dir:
description: 'expoterd NFS directory with host ip address. ex:10.0.0.1:/exports'
description: 'Name of directory to check out'
required: true
depth:
description: 'git clone --depth={} option'
Expand All @@ -40,6 +40,11 @@ runs:
- shell: bash
if: ${{ !env.ACT }}
run: |
if [ -n "$RUNNER_DEBUG" ] || [ -n "$ACTIONS_STEP_DEBUG" ]; then
echo "Enable debug logging"
set -x
fi
echo $GITHUB_ACTION_PATH
source $GITHUB_ACTION_PATH/try.sh
Expand All @@ -64,15 +69,21 @@ runs:
DEPTH=--depth=${{ inputs.depth }}
fi
if [ ! -z "${{ inputs.reference_dir }}" ]; then
REFERENCE_IF_ABLE="--reference-if-able=${{ inputs.reference_dir }}"
fi
try_till_success \
/usr/bin/git clone \
$DEPTH \
--reference-if-able=${{ inputs.reference_dir }} \
$REFERENCE_IF_ABLE \
https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
${{ inputs.checkout_dir }}
if [ $(git config --global --get-all safe.directory | grep -c "$(pwd)$") -eq 0 ]; then
/usr/bin/git config --global --add safe.directory $(pwd)
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}"
fi
pushd ${{ inputs.checkout_dir }}
Expand Down

0 comments on commit 73069d2

Please sign in to comment.