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

github_repository_collaborator: fails when adding a user as a collaborator #59

Closed
rene00 opened this issue Nov 2, 2017 · 2 comments
Closed
Labels
github_enterprise Status: Stale Used by stalebot to clean house Type: Bug Something isn't working as documented

Comments

@rene00
Copy link

rene00 commented Nov 2, 2017

Terraform Version

$ terraform -v
Terraform v0.10.8

Affected Resource(s)

  • github_repository_collaborator

Target provider is running GitHub Enterprise 2.11.2.

Terraform Configuration Files

resource "github_repository" "myrepo" {                       
  provider = "github.myprovider"                                             
  name     = "myrepo"                                         
  private  = true                                                                                                             
}                                                                               
                                                                                
resource "github_repository_collaborator" "myrepo_johnsmith" {                                                                               
  repository = "${github_repository.myrepo.name}"             
  username   = "johnsmith"                                                     
  permission = "push"                                                           
}

Expected Behavior

The user johnsmith should of been added as a collaborator to the myrepo repository.

Actual Behavior

terraform failed to refresh the state:

Error: Error refreshing state: 1 error(s) occurred:

* github_repository_collaborator.myrepo_johnsmith: github_repository_collaborator.myrepo_johnsmith: GET https://REDACTED/api/v3/repos/REDACTED/myrepo/invitations?per_page=100: 415 If you would like to help us test the Repository Invitations during its preview period, you must specify a custom media type in the 'Accept' header. Please see the docs for full details. []


Nothing to change.

I also observed an import failing with a similar error. After adding the user as a collaborator manually through the GitHub Enterprise interface

$ terraform import github_repository_collaborator.myrepo-johnsmith myrepo:johnsmith 
github_repository_collaborator.myrepo-johnsmith: Importing from ID "myrepo:johnsmith"...
github_repository_collaborator.myrepo-johnsmith: Import complete!
  Imported github_repository_collaborator (ID: myrepo:johnsmith)
github_repository_collaborator.myrepo-johnsmith: Refreshing state... (ID: myrepo:johnsmith)
Error importing: 1 error(s) occurred:

* github_repository_collaborator.myrepo-johnsmith (import id: myrepo:johnsmith): 1 error(s) occurred:

* import github_repository_collaborator.myrepo-johnsmith result: myrepo:johnsmith: github_repository_collaborator.myrepo-johnsmith: GET https://REDACTED/api/v3/repos/REDACTED/myrepo/invitations?per_page=100: 415 If you would like to help us test the Repository Invitations during its preview period, you must specify a custom media type in the 'Accept' header. Please see the docs for full details. []

References

Not sure if has anything to do with the issue, though it looks like GitHub changed the way collaborators are added.

https://github.com/blog/2170-repository-invitations
octokit/octokit.net#1410

@github-actions
Copy link

👋 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!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Dec 12, 2022
@github-actions github-actions bot removed the Status: Stale Used by stalebot to clean house label Dec 13, 2022
Copy link

👋 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!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Apr 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_enterprise Status: Stale Used by stalebot to clean house Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

4 participants