From 40ff2b96cebd4feeedefd81f90014272d3952ede Mon Sep 17 00:00:00 2001 From: ange Date: Sun, 2 Feb 2025 00:11:14 +0000 Subject: [PATCH] fix: SUBPATH --- action.yaml | 1 - entrypoint.sh | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index 109717b..16048af 100644 --- a/action.yaml +++ b/action.yaml @@ -7,7 +7,6 @@ inputs: default: ${{ gitea.token }} subpath: description: Limit clone to a single directory inside the repo - default: . runs: using: composite diff --git a/entrypoint.sh b/entrypoint.sh index b4d6138..4ac82bb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,8 @@ git remote add origin "$URL" git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$GITHUB_SHA" git checkout --progress --force -B main "$GITHUB_SHA" -mv "$INPUT_SUBPATH" /bak/ -find . -delete -mv /bak/ . +if [ -n "$INPUT_SUBPATH" ]; then ( + shopt -s extglob dotglob + rm !("$INPUT_SUBPATH") + mv -T "$INPUT_SUBPATH" . +) fi