diff --git a/action.yaml b/action.yaml index 6b62917..109717b 100644 --- a/action.yaml +++ b/action.yaml @@ -1,10 +1,16 @@ +name: Checkout +description: Checkout a Git repository at a particular version + inputs: 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 }} + subpath: + description: Limit clone to a single directory inside the repo + default: . runs: using: composite steps: - name: Checkout - run: ${{ gitea.action_path }}/checkout.sh + run: ${{ gitea.action_path }}/entrypoint.sh diff --git a/checkout.sh b/entrypoint.sh similarity index 84% rename from checkout.sh rename to entrypoint.sh index 9d9075a..b4d6138 100755 --- a/checkout.sh +++ b/entrypoint.sh @@ -6,3 +6,7 @@ git init -b main 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/ .