feat: subpath

This commit is contained in:
ange 2025-02-02 00:03:33 +00:00
parent 16acdfd6fd
commit a1be1fd562
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 12 additions and 2 deletions

View File

@ -1,10 +1,16 @@
name: Checkout
description: Checkout a Git repository at a particular version
inputs: inputs:
token: token:
description: A token to authenticate on behalf of the GitHub App installed on your repository. description: Personal access token (PAT) used to fetch the repository.
default: ${{ gitea.token }} default: ${{ gitea.token }}
subpath:
description: Limit clone to a single directory inside the repo
default: .
runs: runs:
using: composite using: composite
steps: steps:
- name: Checkout - name: Checkout
run: ${{ gitea.action_path }}/checkout.sh run: ${{ gitea.action_path }}/entrypoint.sh

View File

@ -6,3 +6,7 @@ git init -b main
git remote add origin "$URL" 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/
find . -delete
mv /bak/ .