# linear_git_automation_target_branch (Resource)

Manages a target branch pattern for a Linear team's git automation. Reference it from `linear_git_automation_state.target_branch_id` to scope automation rules to pull requests against branches matching this pattern.

## Example Usage

```terraform
resource "linear_git_automation_target_branch" "main" {
  team_id        = linear_team.engineering.id
  branch_pattern = "main"
}

resource "linear_git_automation_target_branch" "release" {
  team_id        = linear_team.engineering.id
  branch_pattern = "^release/.+$"
  is_regex       = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `branch_pattern` (String) Branch name to match, e.g. `main`. Unique within the team. Treated as a regular expression when `is_regex` is true.
- `team_id` (String) UUID of the team the pattern belongs to. Changing it replaces the resource — `gitAutomationTargetBranchUpdate` has no `teamId`.

### Optional

- `is_regex` (Boolean) Whether `branch_pattern` is a regular expression rather than an exact branch name.

### Read-Only

- `id` (String) UUID of the target branch definition.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Import by UUID.
terraform import linear_git_automation_target_branch.example a1b2c3d4-0000-0000-0000-000000000000
```