integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
887 stars 730 forks source link

[Enhancement]: Accepting Slugs for GitHub Repository Environment Reviewers #2135

Open msharbaji opened 7 months ago

msharbaji commented 7 months ago

Describe the need

Description:

Currently, in the github_repository_environment resource, the reviewers attribute expects user and team IDs, which can be cumbersome for users, especially in organizations, where naming conventions are more intuitive when using slugs.

Proposal:

It would be beneficial to enhance the github_repository_environment resource to accept slugs for both user and team identifiers. This would simplify configuration and improve usability for users, allowing them to specify reviewers using more familiar naming conventions.

resource "github_repository_environment" "techops" {
  count = local.has_techops_access

  repository  = 'repo_name'
  environment = "environement_name"
  wait_timer  =  100

  deployment_branch_policy {
    custom_branch_policies = 0
    protected_branches     = 1
  }

  reviewers {
    teams = ["team1", "team2"] # instead of IDs
    users = ["username1"] # instead of IDs
  }
}

SDK Version

terrafrom_provider_github 6..0.0

API Version

No response

Relevant log output

No response

Code of Conduct