fix: SUBPATH

This commit is contained in:
ange 2025-02-02 00:11:14 +00:00
parent a1be1fd562
commit 40ff2b96ce
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 5 additions and 4 deletions

View File

@ -7,7 +7,6 @@ inputs:
default: ${{ gitea.token }} default: ${{ gitea.token }}
subpath: subpath:
description: Limit clone to a single directory inside the repo description: Limit clone to a single directory inside the repo
default: .
runs: runs:
using: composite using: composite

View File

@ -7,6 +7,8 @@ git remote add origin "$URL"
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$GITHUB_SHA" git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$GITHUB_SHA"
git checkout --progress --force -B main "$GITHUB_SHA" git checkout --progress --force -B main "$GITHUB_SHA"
mv "$INPUT_SUBPATH" /bak/ if [ -n "$INPUT_SUBPATH" ]; then (
find . -delete shopt -s extglob dotglob
mv /bak/ . rm !("$INPUT_SUBPATH")
mv -T "$INPUT_SUBPATH" .
) fi