feat: submodules
This commit is contained in:
parent
52e7590325
commit
bf3f4b11e1
2 changed files with 9 additions and 1 deletions
|
@ -7,7 +7,9 @@ inputs:
|
|||
default: ${{ forgejo.token }}
|
||||
subpath:
|
||||
description: Limit clone to a single directory inside the repo
|
||||
|
||||
submodules:
|
||||
description: Whether to checkout submodules (true|recursive)
|
||||
default: false
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
|
|
@ -7,6 +7,12 @@ 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"
|
||||
|
||||
if [ "$INPUT_SUBMODULES" = true ]; then
|
||||
git submodule update --init --single-branch
|
||||
elif [ "$INPUT_SUBMODULES" = recursive ]; then
|
||||
git submodule update --init --single-branch --recursive
|
||||
fi
|
||||
|
||||
if [ -n "$INPUT_SUBPATH" ]; then (
|
||||
shopt -s dotglob
|
||||
git sparse-checkout set "$INPUT_SUBPATH"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue