Customize Git checkout behavior directly in pipeline YAML
You can now configure how the Buildkite agent checks out your source code using a new checkout block in your pipeline YAML. Skip checkout entirely, perform shallow clones, set custom Git flags, and more - all from within your pipeline definition. For example:
checkout:
submodules: false
steps:
- label: "Fast build"
command: "make build"
checkout:
depth: 50
sparse:
paths:
- src/
- .buildkite/
- label: "Full integration tests"
command: "make integration"
checkout:
submodules: trueThe checkout block can be set at both the pipeline level (as a default for all steps) and the step level (to override per step). Previously, customizing checkout behavior required using plugins like Sparse Checkout, Custom Checkout, or Skip Checkout, or setting BUILDKITE_GIT_* environment variables. The native checkout block replaces most of these patterns with a cleaner configuration surface built into the agent.
This feature requires Buildkite Agent v3.136.0 or newer. For the full list of available options, see the Git checkout documentation.
Owen
Start turning complexity into an advantage
Create an account to get started for free.