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]: Not able to create a new user anymore #2321

Open
1 task done
virvirlopez opened this issue Jul 17, 2024 · 4 comments
Open
1 task done

[BUG]: Not able to create a new user anymore #2321

virvirlopez opened this issue Jul 17, 2024 · 4 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@virvirlopez
Copy link

Expected Behavior

Hello,
we have the following code to create new users:

resource "github_membership" "members" {
  for_each = yamldecode(file("./yaml_files/users.yml"))["users"]

  username = lookup(each.value, "username", null)
  role     = lookup(each.value, "role", "member")
}

It has been working until now.

Actual Behavior

When I try to create a new user I get:
PUT https://api.github.com/orgs/: 403 You must be an admin to add or update an organization membership.

But I am an owner and I am able to create users through the UI.
For applying the changes, I am login in with:

gh auth login -w

Terraform Version

  source  = "registry.opentofu.org/integrations/github"
  version = "6.2.2"

opentofu version: 1.6.2

Affected Resource(s)

  • github user creation

Terraform Configuration Files

No response

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@virvirlopez virvirlopez added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jul 17, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Jul 19, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Jul 19, 2024
@kfcampbell
Copy link
Member

What version did this start happening with? I wonder if this is a result of #2304.

@marlonmarcello
Copy link

marlonmarcello commented Jul 23, 2024

We are having a similar issue here, when trying to add a user to the org in our case, we get a:
Error: PUT https://api.github.com/orgs/wethegit/memberships/user-name: 403 You must be an admin to add or update an organization membership. []

@d-xo
Copy link

d-xo commented Jul 25, 2024

Running into this when trying to change a users role. I am authenticated with the gh cli tool. I am an owner of the org and can make these changes via the UI. Running the following versions:

> tofu --version
OpenTofu v1.7.3
on linux_amd64
+ provider registry.opentofu.org/integrations/github v6.2.3

@clonker
Copy link

clonker commented Jul 31, 2024

Resolved in my case by adding admin:org to the gh token scopes (eg via gh auth refresh --scopes admin:org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

5 participants