lfreleng-actions/🔄 Gerrit Clone Action
Bulk clone repositories from Gerrit servers with multi-threading and retry logic
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 6, 2026
- License
- None
Pinned Snippet
uses: lfreleng-actions/gerrit-clone-action@f4ff1d5f29e2d6a9f6d689fba4ff7ffe6fc9ff49 # v2.1.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| host | Source hostname (Gerrit server or GitHub host, e.g. github.com or github.com/ORG) | yes | — |
| port | Gerrit SSH port | no | 29418 |
| ssh-user | SSH username for clone operations | no | — |
| ssh-private-key | SSH private key content for authentication | no | — |
| source-type | Source type: gerrit or github (auto-detected from host) | no | — |
| github-token | GitHub personal access token for API access and private repos | no | — |
| github-org | GitHub organization or user (auto-detected from host) | no | — |
| use-gh-cli | Use GitHub CLI (gh) for cloning instead of git | no | false |
| base-url | Base URL for Gerrit API (defaults to https://HOST) | no | — |
| output-path | Clone destination (default: auto-creates ./{SERVER}/ or ./github.com/{ORG}/ structure) | no | . |
| skip-archived | Skip archived/read-only repositories | no | true |
| include-projects | Restrict 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-projects | Exclude specific project(s) from cloning. Applied after include filters. Supports shell-style wildcards (*, ?, [seq]), hierarchical matching, and comma or space-separated lists. | no | — |
| ssh-debug | Enable verbose SSH (-vvv) for troubleshooting authentication | no | false |
| allow-nested-git | Allow nested git working trees when cloning both parent and child repositories | no | true |
| nested-protection | Auto-add nested child repo paths to parent .git/info/exclude | no | true |
| move-conflicting | Move conflicting files/directories in parent repos to allow nested cloning | no | true |
| exit-on-error | Exit cloning immediately when the first error occurs (for debugging) | no | false |
| no-refresh | Skip refreshing existing repositories | no | false |
| force-refresh | Force refresh all existing repos (auto-stash, fix detached HEAD) | no | false |
| fetch-only | Only fetch changes without merging (existing repos) | no | false |
| skip-conflicts | Skip repos with uncommitted changes during refresh | no | true |
| threads | Number of concurrent clone threads | no | — |
| depth | Create shallow clone with given depth | no | — |
| branch | Clone specific branch instead of default | no | — |
| mirror | Use git clone --mirror for complete repository metadata (all refs, tags, branches). Creates bare repository. Incompatible with depth and branch options. | no | true |
| set-default-branch | After 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. | no | true |
| fix-default-branch | After 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. | no | true |
| use-https | Use HTTPS for cloning instead of SSH | no | false |
| http-user | HTTP username for Gerrit HTTPS authentication | no | — |
| http-password | HTTP password for Gerrit HTTPS authentication | no | — |
| no-netrc | Disable .netrc credential lookup for HTTP auth | no | false |
| netrc-file | Explicit path to .netrc file for HTTP credentials | no | — |
| netrc-optional | Whether missing .netrc is acceptable (false = fail if not found) | no | true |
| discovery-method | Discovery 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-protocol | Preserve original protocol for remote (default: SSH) | no | false |
| strict-host | SSH strict host key checking | no | true |
| clone-timeout | Timeout per clone operation in seconds | no | 600 |
| retry-attempts | Maximum retry attempts per repository | no | 3 |
| retry-base-delay | Base delay for retry backoff in seconds | no | 2.0 |
| retry-factor | Exponential backoff factor for retries | no | 2.0 |
| retry-max-delay | Maximum retry delay in seconds | no | 30.0 |
| manifest-filename | Output manifest filename | no | clone-manifest.json |
| config-file | Configuration file path (YAML or JSON) | no | — |
| verbose | Enable verbose/debug output | no | false |
| quiet | Suppress all output except errors | no | false |
| log-file | Custom log file path (default: gerrit-clone.log in current directory) | no | — |
| disable-log-file | Disable creation of log file | no | false |
| log-level | File logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) | no | DEBUG |
| remove-files | Comma-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-filter | Replace 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-secrets | Scan 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. | no | false |
| build-from-source | Build CLI from the action's own source instead of installing from PyPI (useful for testing unreleased code) | no | false |
Outputs
| name | description |
|---|---|
| manifest-path | Path to the generated clone manifest file |
| success-count | Number of successfully cloned repositories |
| failure-count | Number of failed clone attempts |
| total-count | Total number of repositories processed |
| skipped-count | Number of skipped repositories |
| already-exists-count | Number of repos that already existed (not refreshed) |
| refreshed-count | Number of existing repos that were refreshed |
| verified-count | Number of repos verified as up-to-date |
| duration | Total duration of the operation in seconds |
| success-rate | Success rate as a percentage |