integrations / terraform-provider-github

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

github_repository_collaborators does not support custom repository role #1775

Closed alk-jozog closed 1 year ago

alk-jozog commented 1 year ago

Hello,

I've created a custom role named repo-owners with resource github_organization_custom_role. When trying to use it with github_repository_collaborators, it fails with

repo-owners is an invalid value for argument team.2.permission

Documentation states that:

Must be one of pull, push, maintain, triage or admin or the name of an existing custom repository role within the organization for organization-owned repositories.

but looking at the code it seems te me it only supports the hardcoded list of builtin roles https://github.com/integrations/terraform-provider-github/blob/main/github/resource_github_repository_collaborators.go#L60

kfcampbell commented 1 year ago

@alk-jozog You're totally right! That validation line should be removed. Would you like to create a PR or should I?

jsifuentes commented 1 year ago

Hi. I ran into this issue today and opened #1781 to fix this issue.