feat: add branch_protection resource (#72)
added terraform tests for the resource Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/72 Co-authored-by: Jörg Markert <joerg.markert@gmail.com> Co-committed-by: Jörg Markert <joerg.markert@gmail.com>
This commit is contained in:

committed by
techknowlogick

parent
aa450c1855
commit
a07bd291f5
@ -2,7 +2,7 @@ terraform {
|
||||
required_providers {
|
||||
gitea = {
|
||||
source = "go-gitea/gitea"
|
||||
version = "0.1.0"
|
||||
version = "0.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,4 +12,4 @@ provider "gitea" {
|
||||
username = "lerentis"
|
||||
password = var.gitea_password
|
||||
#token = var.gitea_token
|
||||
}
|
||||
}
|
||||
|
14
examples/resources/gitea_repo_branch_protection/resource.tf
Normal file
14
examples/resources/gitea_repo_branch_protection/resource.tf
Normal file
@ -0,0 +1,14 @@
|
||||
resource "gitea_repository" "repo" {
|
||||
username = var.username
|
||||
name = var.name
|
||||
auto_init = false
|
||||
}
|
||||
|
||||
resource "gitea_repository_branch_protection" "main" {
|
||||
username = gitea_repository.repo.username
|
||||
name = gitea_repository.repo.name
|
||||
|
||||
rule_name = "main"
|
||||
enable_push = true
|
||||
status_check_patterns = var.branch_protection_patterns
|
||||
}
|
Reference in New Issue
Block a user