Fork with gitlab_project doesn't have option to set branches
Bug Report
Currently doesn't seem to be an option to set the branches to fork via the gitlab_project. Trying to set one using the API as reference causes the code to fail.
API Reference: https://docs.gitlab.com/16.10/ee/api/projects.html#fork-project
Relevant Terraform Configuration
resource "gitlab_project" "gp" {
name = var.name
description = var.description
only_allow_merge_if_all_discussions_are_resolved = true
only_allow_merge_if_pipeline_succeeds = true
remove_source_branch_after_merge = true
request_access_enabled = false
initialize_with_readme = var.fork_from != null ? null : true
keep_latest_artifact = false
namespace_id = var.namespace_id
ci_config_path = var.ci_config_path
merge_method = "ff"
squash_option = "default_on"
visibility_level = var.visibility
archive_on_destroy = true
forked_from_project_id = var.fork_from
path = var.path
mr_default_target_self = true
allow_merge_on_skipped_pipeline = false
branches = "master"
}
Relevant Terraform Command
terraform validate
Relevant Log Output
These are the debug logs of the `terraform` command output:
╷
│ Error: Unsupported argument
│
│ on modules/project/main.tf line 20, in resource "gitlab_project" "gp":
│ 20: branches = "master"
│
│ An argument named "branches" is not expected here.
Additional Details
- GitLab Terraform Provider Version:
v16.11.0 - GitLab Version:
v16.10.5-ee - Terraform Version:
v1.8.3