Checkout
Cigen automatically inserts a checkout step at the start of every job. By default this is a fast, shallow checkout implemented by a built-in shallow_checkout command.
Configuration
Section titled “Configuration”Checkout can be configured at multiple levels, with this precedence:
- Job-level
checkout - Workflow-level
checkout - Global
checkout - Defaults (shallow checkout)
Parameters
Section titled “Parameters”shallow(boolean, default: true): when false, use CircleCI’s standardcheckoutstepclone_options(string): options for the initial clone, e.g.--depth 1 --verbosefetch_options(string): options forgit fetch, e.g.--depth 10tag_fetch_options(string): options for fetching tags (default:--tags)keyscan(map): add SSH host keys (github,gitlab,bitbucket⇒ boolean)path(string): checkout directory
Disable Checkout
Section titled “Disable Checkout”Set checkout: false at the global, workflow, or job level to skip inserting any checkout step for those scopes.
jobs:lint: image: cimg/node:20.11 checkout: false # do not checkout repo for this job steps: - run: npm run lintGlobal Example
Section titled “Global Example”checkout: shallow: true clone_options: "--depth 1" fetch_options: "--depth 10" tag_fetch_options: "--tags" keyscan: github: true gitlab: false bitbucket: false path: "."Job Override Example
Section titled “Job Override Example”jobs:build: image: cimg/node:20.11 checkout: shallow: true fetch_options: "--depth 50 --no-tags" steps: - run: npm run buildGenerated Output
Section titled “Generated Output”steps:- shallow_checkout- run: name: Build application command: npm run buildsteps:- shallow_checkout: fetch_options: --depth 50 --no-tags keyscan_github: true path: .steps:- checkout- run: name: Build application command: npm run buildBest Practices
Section titled “Best Practices”- Prefer shallow checkout for most jobs to reduce time and IO.
- Increase
fetch_optionsdepth in jobs that need more history (e.g., changelog tooling). - Use
tag_fetch_optionswhen building from tags; disable tags (--no-tags) to reduce noise if unused. - Enable
keyscanonly for hosts you actually use (GitHub/GitLab/Bitbucket). - Use
pathwhen checking out into a subdirectory.
Migration
Section titled “Migration”If your configs include explicit checkout steps in job definitions:
- Remove manual
checkoutsteps; cigen now inserts checkout automatically. - If you required full history, set
checkout.shallow: falseat the appropriate scope. - If you used custom clone or fetch options, move them under the
checkoutsection.