Skip to content

Destination Branches

Destination Branches allows for the configuration of allowed source to destination branches for Terrateam operations. Default Terrateam behavior requires a pull request to have the default branch of the repository as the destination branch. This branch is usually named main or master.

Terrateam Configuration Terrateam behavior can be configured via a config.yml. This file is located in a directory named .terrateam at the root of your Terraform repository: .terrateam/config.yml.

See Configuration documentation for details.


Top-level key: destination_branches

See Configuration Reference documentation for details.

branchStringThe branch that a pull request can be merged into.
source_branchesListThe branch name that can be merged.

Default configuration:


The destination_branches directive specifies a list of allowed destination branches with an optional list of source branches. Each entry in the list can either be a string or an object.

The following three configurations are identical:

  • A string:
- main
  • An object only specifying the branch attribute:
- branch: main
  • An object, specifying source_branches using a glob to match all branches:
- branch: main
source_branches: ['*']

Branch and Source Branches


The branch attribute matches the branch that a pull request will be merged into.


The source_branches attribute matches the branch name that will be merged.

Example Scenario

Using the destination_branches configuration above, consider the following pull request:

  • Source branch: hotfix/revert-ami
  • Destination branch: main

Terrateam would evaluate the pull request as follows:

  • The main branch matches against the branch attribute
  • The hotfix/revert-ami matches against the source_branches attribute

Matching Branches

The list of branches are evaluated in order, stopping at the first matching destination branch.

If the destination_branches configuration is specified, the repository’s default branch will not automatically be considered for evaluation.

The default branch must be in the list of branches to be an allowed destination branch.


Globs are supported in branch names and source branches using the * glob character.

Not Patterns

A ! can be placed before a source branch pattern to negate it.

This is only valid in the source_branches configuration.

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 .