From e2d81de47f93afa8b956f218a6933b09a8fe7f44 Mon Sep 17 00:00:00 2001 From: Junichiro Kasuya Date: Tue, 14 Nov 2023 18:58:52 +0900 Subject: [PATCH 1/4] Enable debug logging --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index 7ce0582..87a8e30 100644 --- a/action.yml +++ b/action.yml @@ -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 From 053499efaa585258d228da10bc6a7e1a0c9e05d3 Mon Sep 17 00:00:00 2001 From: Junichiro Kasuya Date: Tue, 14 Nov 2023 19:09:59 +0900 Subject: [PATCH 2/4] =?UTF-8?q?reference=5Fdir=E6=8C=87=E5=AE=9A=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=81=BF=20--reference-if-able=20=E3=82=92=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 87a8e30..f6c77a3 100644 --- a/action.yml +++ b/action.yml @@ -69,10 +69,14 @@ 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 }} From 1a5d2e27d87fa4fd92c93da4bd8cc220bc44219d Mon Sep 17 00:00:00 2001 From: Junichiro Kasuya Date: Tue, 14 Nov 2023 19:25:07 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Checkout=E3=81=AE=E3=83=91=E3=82=B9?= =?UTF-8?q?=E3=81=8C=E7=95=B0=E3=81=AA=E3=82=8B=E3=81=A8=E3=81=8D=E3=80=81?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B=E7=8F=BE?= =?UTF-8?q?=E8=B1=A1=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index f6c77a3..3693603 100644 --- a/action.yml +++ b/action.yml @@ -80,8 +80,10 @@ runs: 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 }} From 4e65c753460c1920b8ab8f943e25825008979b0e Mon Sep 17 00:00:00 2001 From: Junichiro Kasuya Date: Tue, 14 Nov 2023 19:26:15 +0900 Subject: [PATCH 4/4] =?UTF-8?q?description=E3=81=AE=E8=A8=98=E8=BF=B0?= =?UTF-8?q?=E3=81=8C=E9=96=93=E9=81=95=E3=81=88=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3693603..b2ad9fe 100644 --- a/action.yml +++ b/action.yml @@ -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'