diff --git a/action.yaml b/action.yaml index 090643d..48fa01e 100644 --- a/action.yaml +++ b/action.yaml @@ -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: diff --git a/entrypoint.sh b/entrypoint.sh index 46737d4..0889105 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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"