Skip to content

github_repository_collaborator broken since v2.8.0 #469

@tpatzig

Description

@tpatzig

Since github provider v2.8.0 the github_repository_collaborator resource is broken.
It fails with User <username> is already a collaborator. In v2.7.0 this worked as expected.

Terraform Version

v0.12.25

Affected Resource(s)

  • github_repository_collaborator

Terraform Configuration Files

resource "github_repository" "my_repo" {
  name        = "my_repo"
  private     = true
  description = ""
}

resource "github_repository_collaborator" "user_foobar" {
  repository  = github_repository.my_repo.name
  username   = "foobar"
  permission = "pull"
}

Panic Output

Expected Behavior

What should have happened?

The collaborator should be added to the repository and the resource should be in the state.

Actual Behavior

What actually happened?

The collaborator gets added to the repository with the correct permissions,
but terraform fails with this error and the resource is not in the state.

Error: User foobar is already a collaborator

  on test.tf line 7, in resource "github_repository_collaborator" "user_foobar":
  7: resource "github_repository_collaborator" "user_foobar" {

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions