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 }}
|
default: ${{ forgejo.token }}
|
||||||
subpath:
|
subpath:
|
||||||
description: Limit clone to a single directory inside the repo
|
description: Limit clone to a single directory inside the repo
|
||||||
|
submodules:
|
||||||
|
description: Whether to checkout submodules (true|recursive)
|
||||||
|
default: false
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -7,6 +7,12 @@ 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"
|
||||||
|
|
||||||
|
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 (
|
if [ -n "$INPUT_SUBPATH" ]; then (
|
||||||
shopt -s dotglob
|
shopt -s dotglob
|
||||||
git sparse-checkout set "$INPUT_SUBPATH"
|
git sparse-checkout set "$INPUT_SUBPATH"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue