This repository was archived by the owner on Feb 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ inputs:
2626 description : ' Clone with fetching LFS .'
2727 default : false
2828 checkout_dir :
29- description : ' expoterd NFS directory with host ip address. ex:10.0.0.1:/exports '
29+ description : ' Name of directory to check out '
3030 required : true
3131 depth :
3232 description : ' git clone --depth={} option'
4040 - shell : bash
4141 if : ${{ !env.ACT }}
4242 run : |
43+ if [ -n "$RUNNER_DEBUG" ] || [ -n "$ACTIONS_STEP_DEBUG" ]; then
44+ echo "Enable debug logging"
45+ set -x
46+ fi
47+
4348 echo $GITHUB_ACTION_PATH
4449 source $GITHUB_ACTION_PATH/try.sh
4550
@@ -64,15 +69,21 @@ runs:
6469 DEPTH=--depth=${{ inputs.depth }}
6570 fi
6671
72+ if [ ! -z "${{ inputs.reference_dir }}" ]; then
73+ REFERENCE_IF_ABLE="--reference-if-able=${{ inputs.reference_dir }}"
74+ fi
75+
6776 try_till_success \
6877 /usr/bin/git clone \
6978 $DEPTH \
70- --reference-if-able=${{ inputs.reference_dir }} \
79+ $REFERENCE_IF_ABLE \
7180 https://${{ inputs.github_actor }}:${{ inputs.github_token }}@github.com/${{ inputs.github_repository }}.git \
7281 ${{ inputs.checkout_dir }}
7382
74- if [ $(git config --global --get-all safe.directory | grep -c "$(pwd)$") -eq 0 ]; then
75- /usr/bin/git config --global --add safe.directory $(pwd)
83+ CHECKOUT_FULL_PATH="$(pwd)${{ inputs.checkout_dir }})"
84+ CHECKOUT_FULL_PATH="$(realpath $CHECKOUT_FULL_PATH)"
85+ if [ $(git config --global --get-all safe.directory | grep -c "${CHECKOUT_FULL_PATH}$") -eq 0 ]; then
86+ /usr/bin/git config --global --add safe.directory "${CHECKOUT_FULL_PATH}"
7687 fi
7788
7889 pushd ${{ inputs.checkout_dir }}
You can’t perform that action at this time.
0 commit comments