integrations / terraform-provider-github

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

[BUG]: github_team_membership fails to create resource for a team with forward-slashes #2018

Closed rcambrj closed 2 months ago

rcambrj commented 12 months ago

Expected Behavior

Should attach user to team. The provider should swap / (forward slashes) for - (hyphens) when issuing GET on the team resource, like so:

https://github.com/orgs/[...]/teams/foo/bar

becomes:

https://github.com/orgs/[...]/teams/foo-bar

Actual Behavior

│ Error: strconv.ParseInt: parsing "foo/bar": invalid syntaxGET https://api.github.com/orgs/[...]/teams/foo/bar: 404 Not Found []
│
│   with module.github.github_team_membership.this["foo-bar"],
│   on github/main.tf line 11, in resource "github_team_membership" "this":
│   11: resource "github_team_membership" "this" {
│

Terraform Version

Terraform v1.5.7
on darwin_amd64
+ provider registry.terraform.io/integrations/github v5.42.0

Affected Resource(s)

Terraform Configuration Files

resource "github_team_membership" "foo-bar" {
  team_id = "foo/bar"
  username = "rcambrj"
  role = "maintainer"
}

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Code of Conduct

github-actions[bot] commented 12 months ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

github-actions[bot] commented 2 months ago

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!