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
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:
See Configuration documentation for details.
See Configuration Reference documentation for details.
|branch||String||The branch that a pull request can be merged into.|
|source_branches||List||The branch name that can be merged.|
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
The following three configurations are identical:
- A string:
destination_branches: - main
- An object only specifying the
destination_branches: - branch: main
- An object, specifying
source_branchesusing a glob to match all branches:
destination_branches: - branch: main source_branches: ['*']
Branch and Source Branches
branch attribute matches the branch that a pull request will be merged
source_branches attribute matches the branch name that will be
destination_branches configuration above, consider the following pull request:
- Source branch:
- Destination branch:
Terrateam would evaluate the pull request as follows:
mainbranch matches against the
hotfix/revert-amimatches against the
The list of branches are evaluated in order, stopping at the first matching destination branch.
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
! can be placed before a source branch pattern to negate it.
This is only valid in the