diff --git a/test/unit-complete/main.tf b/test/unit-complete/main.tf index daf94a3..164fd55 100644 --- a/test/unit-complete/main.tf +++ b/test/unit-complete/main.tf @@ -32,7 +32,7 @@ module "repository" { name = var.name description = var.description homepage_url = var.url - private = false + visibility = "public" has_issues = var.has_issues has_projects = var.has_projects has_wiki = var.has_wiki @@ -42,7 +42,6 @@ module "repository" { allow_auto_merge = var.allow_auto_merge delete_branch_on_merge = var.delete_branch_on_merge is_template = var.is_template - has_downloads = var.has_downloads auto_init = var.auto_init gitignore_template = var.gitignore_template license_template = var.license_template @@ -50,14 +49,10 @@ module "repository" { topics = var.topics archive_on_destroy = false - branches = [ - { - name = "develop" - }, - { - name = "staging" - }, - ] + branches = { + develop = {}, + staging = {}, + } admin_collaborators = ["kevcube"] @@ -87,9 +82,8 @@ module "repository" { secret = var.webhook_secret }] - branch_protections_v4 = [ - { - pattern = "staging" + branch_protections = { + staging = { allows_deletions = false allows_force_pushes = false @@ -109,39 +103,7 @@ module "repository" { strict = true } } - ] - - branch_protections_v3 = [ - { - branch = "main" - enforce_admins = true - require_conversation_resolution = true - require_signed_commits = true - - required_status_checks = { - strict = true - checks = ["ci/travis"] - } - - required_pull_request_reviews = { - dismiss_stale_reviews = true - dismissal_users = [var.team_user] - dismissal_teams = [github_team.team.name] - require_code_owner_reviews = true - required_approving_review_count = 1 - } - - restrictions = { - users = [var.team_user] - teams = [github_team.team.name] - } - }, - { - branch = "develop" - enforce_admins = true - require_signed_commits = true - } - ] + } issue_labels = var.issue_labels @@ -172,13 +134,10 @@ module "repository-with-defaults" { name = var.repository_with_defaults_name description = var.repository_with_defaults_description - defaults = var.repository_defaults default_branch = "development" archive_on_destroy = false - branches = [ - { name = "development" }, - ] + branches = { development = {} } } # --------------------------------------------------------------------------------------------------------------------- diff --git a/test/unit-complete/provider.tf b/test/unit-complete/provider.tf index 7eb2e89..b95beaa 100644 --- a/test/unit-complete/provider.tf +++ b/test/unit-complete/provider.tf @@ -1,6 +1,4 @@ -provider "github" { - owner = "kbc-trading" -} +provider "github" {} terraform { required_version = "~> 1.0" @@ -9,7 +7,7 @@ terraform { github = { source = "integrations/github" # mask providers with broken branch protection v3 imlementation - version = "~> 5.0, !=5.3.0, !=5.4.0, !=5.5.0, !=5.6.0, !=5.7.0" + version = "~> 6" } tls = { source = "hashicorp/tls"