Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: github_team_repository does not accept pre-defined "custom" roles #2498

Open
Invincibear opened this issue Dec 4, 2024 · 1 comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@Invincibear
Copy link

Expected Behavior

I should be able to specify the pre-defined "write" role, but it will 422 fail validation. When manually CURLing the API, you have to change permission to role for it to not fail 422. It isn't documented, I did it on a hunch and it worked.

The description implies that I can specify a role, but it doesn't actually work:
permission - (Optional) The permissions of team members regarding the repository. Must be one of pull, triage, push, maintain, admin or the name of an existing custom repository role within the organisation. Defaults to pull.

Actual Behavior

422 validation error

Terraform Version

Terraform v1.9.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.2
+ provider registry.terraform.io/hashicorp/azurerm v4.4.0
+ provider registry.terraform.io/hashicorp/time v0.12.1
+ provider registry.terraform.io/integrations/github v6.4.0

Affected Resource(s)

  • github_repository_collaborator
  • github_repository_collaborators
  • github_team_repository

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

resource "github_team_repository" "some_team_repo" {
  team_id    = github_team.some_team.id
  repository = github_repository.some_repo.name
  permission = "write"
}

Panic Output

Error: PUT https://api.github.com/organizations/{org}/team/{team}/repos/{owner}/{repo}: 422 Validation Failed []


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@Invincibear Invincibear added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Dec 4, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Triage in 🧰 Octokit Active Dec 4, 2024
@stevehipwell
Copy link
Contributor

@Invincibear github/rest-api-description#564 looks related. You might want to also open an issue at google/go-github as this TF provider uses that as the GitHub SDK and without support there it can't be fixed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

2 participants