lfreleng-actions/🔄 Gerrit Clone Action

Bulk clone repositories from Gerrit servers with multi-threading and retry logic

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 6, 2026
License
None

Pinned Snippet

workflow.ymlSHA-pinned
uses: lfreleng-actions/gerrit-clone-action@f4ff1d5f29e2d6a9f6d689fba4ff7ffe6fc9ff49 # v2.1.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
hostSource hostname (Gerrit server or GitHub host, e.g. github.com or github.com/ORG)yes—
portGerrit SSH portno29418
ssh-userSSH username for clone operationsno—
ssh-private-keySSH private key content for authenticationno—
source-typeSource type: gerrit or github (auto-detected from host)no—
github-tokenGitHub personal access token for API access and private reposno—
github-orgGitHub organization or user (auto-detected from host)no—
use-gh-cliUse GitHub CLI (gh) for cloning instead of gitnofalse
base-urlBase URL for Gerrit API (defaults to https://HOST)no—
output-pathClone destination (default: auto-creates ./{SERVER}/ or ./github.com/{ORG}/ structure)no.
skip-archivedSkip archived/read-only repositoriesnotrue
include-projectsRestrict cloning to specific project(s). Supports shell-style wildcards (*, ?, [seq]), hierarchical matching (e.g. 'ccsdk' includes ccsdk/apps), and comma or space-separated lists.no—
exclude-projectsExclude specific project(s) from cloning. Applied after include filters. Supports shell-style wildcards (*, ?, [seq]), hierarchical matching, and comma or space-separated lists.no—
ssh-debugEnable verbose SSH (-vvv) for troubleshooting authenticationnofalse
allow-nested-gitAllow nested git working trees when cloning both parent and child repositoriesnotrue
nested-protectionAuto-add nested child repo paths to parent .git/info/excludenotrue
move-conflictingMove conflicting files/directories in parent repos to allow nested cloningnotrue
exit-on-errorExit cloning immediately when the first error occurs (for debugging)nofalse
no-refreshSkip refreshing existing repositoriesnofalse
force-refreshForce refresh all existing repos (auto-stash, fix detached HEAD)nofalse
fetch-onlyOnly fetch changes without merging (existing repos)nofalse
skip-conflictsSkip repos with uncommitted changes during refreshnotrue
threadsNumber of concurrent clone threadsno—
depthCreate shallow clone with given depthno—
branchClone specific branch instead of defaultno—
mirrorUse git clone --mirror for complete repository metadata (all refs, tags, branches). Creates bare repository. Incompatible with depth and branch options.notrue
set-default-branchAfter pushing to GitHub, set the default branch to match the HEAD symbolic ref from the Gerrit clone (default: enabled). Gerrit parent projects (HEAD → refs/meta/config, no code branches) are detected and skipped with an informational message.notrue
fix-default-branchAfter syncing, repair any existing GitHub repositories that have no default branch configured (default: enabled). Gerrit parent projects are identified and logged at INFO level rather than flagged as errors. Real repositories whose previous push failed are fixed by selecting the best candidate branch.notrue
use-httpsUse HTTPS for cloning instead of SSHnofalse
http-userHTTP username for Gerrit HTTPS authenticationno—
http-passwordHTTP password for Gerrit HTTPS authenticationno—
no-netrcDisable .netrc credential lookup for HTTP authnofalse
netrc-fileExplicit path to .netrc file for HTTP credentialsno—
netrc-optionalWhether missing .netrc is acceptable (false = fail if not found)notrue
discovery-methodDiscovery method: ssh, http, both, or github_api. Leave empty to derive from the clone protocol (http with use-https, otherwise ssh; github_api for GitHub sources).no""
keep-remote-protocolPreserve original protocol for remote (default: SSH)nofalse
strict-hostSSH strict host key checkingnotrue
clone-timeoutTimeout per clone operation in secondsno600
retry-attemptsMaximum retry attempts per repositoryno3
retry-base-delayBase delay for retry backoff in secondsno2.0
retry-factorExponential backoff factor for retriesno2.0
retry-max-delayMaximum retry delay in secondsno30.0
manifest-filenameOutput manifest filenamenoclone-manifest.json
config-fileConfiguration file path (YAML or JSON)no—
verboseEnable verbose/debug outputnofalse
quietSuppress all output except errorsnofalse
log-fileCustom log file path (default: gerrit-clone.log in current directory)no—
disable-log-fileDisable creation of log filenofalse
log-levelFile logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)noDEBUG
remove-filesComma-separated list of file path patterns to remove from cloned repositories. Supports shell-style globs (e.g. '.github/**', '*.jar') and regex patterns (prefix with 'regex:'). Uses git filter-repo when available, falls back to worktree-based removal.no—
git-filterReplace tokens in git history for matching projects. Format: 'project:token1,token2;project2:token3'. Semicolons separate project entries. Colons separate project patterns from comma-separated tokens.no—
redact-secretsScan repository content for well-known credential patterns (e.g. GitLab PATs, GitHub PATs, AWS keys) and replace them with safe placeholder values. Uses git filter-repo to rewrite history.nofalse
build-from-sourceBuild CLI from the action's own source instead of installing from PyPI (useful for testing unreleased code)nofalse
namedescription
manifest-pathPath to the generated clone manifest file
success-countNumber of successfully cloned repositories
failure-countNumber of failed clone attempts
total-countTotal number of repositories processed
skipped-countNumber of skipped repositories
already-exists-countNumber of repos that already existed (not refreshed)
refreshed-countNumber of existing repos that were refreshed
verified-countNumber of repos verified as up-to-date
durationTotal duration of the operation in seconds
success-rateSuccess rate as a percentage