Skip to content

Checkout strategy

The checkout_strategy directive in Terrateam allows you to specify how Terrateam performs a code checkout from the pull request.

Configuration

Checkout strategy is configured in the .terrateam/config.yml file under the checkout_strategy key. Here’s the default configuration:

checkout_strategy: merge

Checkout strategy options

The checkout_strategy key can be set to one of the following values:

ValueDescription
merge(Default) Terrateam will perform a merge of the pull request’s head commit into the base branch. This is equivalent to running git checkout <base_branch> followed by git merge <head_commit>.
headTerrateam will checkout the pull request’s head commit directly. This is equivalent to running git checkout <head_commit>.

Examples

Using the default merge strategy

checkout_strategy: merge

This configuration will use the default merge strategy, where Terrateam will perform a merge of the pull request’s head commit into the base branch.

Using the head checkout strategy

checkout_strategy: head

This configuration will use the head strategy, where Terrateam will checkout the pull request’s head commit directly.

Considerations

When choosing a checkout strategy, keep the following in mind:

  • The merge strategy (default) is generally recommended, as it ensures that the changes being applied are compatible with the current state of the base branch.
  • The head strategy can be useful in situations where you want to test the changes in isolation, without considering any changes that may have been made to the base branch since the pull request was opened.
  • If you are using a custom workflow that includes steps that modify the working directory (e.g., running tests or linters), be aware that the checkout strategy can impact the files that are present in the working directory.
We use cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy .