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