Import pre-existing Gitea branch protections
Why: - tofu apply fails with "Branch protection already exist" because the nine repos protected in #60 already have live branch protection in Gitea that is absent from Terraform state, so Terraform tries to create rules that already exist and Gitea rejects them. - The pinned go-gitea/gitea provider 0.7.0 defines no importer for gitea_repository_branch_protection, so the existing rules cannot be adopted on that version. How: - Bump the gitea provider from 0.7.0 to 0.8.1, which adds an importer for gitea_repository_branch_protection (id format <org>/<repo>/<rule_name>). - Add import blocks adopting the nine existing branch protections into state instead of recreating them.
This commit is contained in:
@@ -3,7 +3,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.7.0"
|
||||
version = "0.8.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.7.0"
|
||||
version = "0.8.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.7.0"
|
||||
version = "0.8.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.7.0"
|
||||
version = "0.8.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.7.0"
|
||||
version = "0.8.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.7.0"
|
||||
version = "0.8.1"
|
||||
}
|
||||
random = {
|
||||
source = "hashicorp/random"
|
||||
|
||||
Reference in New Issue
Block a user