terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[BUG]: Can't destroy github_repository_collaborators with security manager team

Open boekkooi-lengoo opened this issue 1 year ago • 5 comments

Expected Behavior

The teams are removed except for the "security manager team".

Actual Behavior

Error: DELETE https://api.github.com/orgs/<org>/teams/security-squad/repos/<org>/example: 403 You cannot remove repositories from a security manager team. []

Terraform Version

Terraform v1.6.2 on linux_amd64

  • provider registry.terraform.io/hashicorp/google v5.2.0
  • provider registry.terraform.io/integrations/github v5.40.0

Affected Resource(s)

  • github_repository_collaborators

Terraform Configuration Files

resource "github_repository" "repository" {
  name = "example"
}

resource "github_repository_collaborators" "collaborators" {
  repository = github_repository.repository.name

  team {
    team_id = "security-squad"
  }
  team {
    team_id = "other-team"
  }
}

Steps to Reproduce

In GitHub setup the Team security-squad with the security manager role.

With the provided config run terraform apply -auto-approve then run terraform apply -auto-approve -destroy. Enjoy the error :smile:

Debug Output

No response

Panic Output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

boekkooi-lengoo avatar Nov 23 '23 10:11 boekkooi-lengoo