Provides a GitHub repository collaborator resource.
This resource allows you to add/remove collaborators from repositories in your organization or personal account. For organization repositories, collaborators can have explicit (and differing levels of) read, write, or administrator access to specific repositories, without giving the user full organization membership. For personal repositories, collaborators can only be granted write (implicitly includes read) permission.
When applied, an invitation will be sent to the user to become a collaborator on a repository. When destroyed, either the invitation will be cancelled or the collaborator will be removed from the repository.
This resource is non-authoritative, for managing ALL collaborators of a repo, use github_repository_collaborators instead.
Further documentation on GitHub collaborators:
# Add a collaborator to a repository
resource "github_repository_collaborator" "a_repo_collaborator" {
repository = "our-cool-repo"
username = "SomeUser"
permission = "admin"
}
The following arguments are supported:
repository
- (Required) The GitHub repositoryusername
- (Required) The user to add to the repository as a collaborator.permission
- (Optional) The permission of the outside collaborator for the repository.
Must be one of pull
, push
, maintain
, triage
or admin
or the name of an existing custom repository role within the organization for organization-owned repositories.
Must be push
for personal repositories. Defaults to push
.permission_diff_suppression
- (Optional) Suppress plan diffs for triage
and maintain
. Defaults to false
.In addition to the above arguments, the following attributes are exported:
invitation_id
- ID of the invitation to be used in github_user_invitation_accepter
GitHub Repository Collaborators can be imported using an ID made up of repository:username
, e.g.
$ terraform import github_repository_collaborator.collaborator terraform:someuser