RepositoryCollaborator

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 (implictly 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.

Further documentation on GitHub collaborators:

Example Usage

using Pulumi;
using Github = Pulumi.Github;

class MyStack : Stack
{
    public MyStack()
    {
        // Add a collaborator to a repository
        var aRepoCollaborator = new Github.RepositoryCollaborator("aRepoCollaborator", new Github.RepositoryCollaboratorArgs
        {
            Permission = "admin",
            Repository = "our-cool-repo",
            Username = "SomeUser",
        });
    }

}

Coming soon!

import pulumi
import pulumi_github as github

# Add a collaborator to a repository
a_repo_collaborator = github.RepositoryCollaborator("aRepoCollaborator",
    permission="admin",
    repository="our-cool-repo",
    username="SomeUser")
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

// Add a collaborator to a repository
const aRepoCollaborator = new github.RepositoryCollaborator("a_repo_collaborator", {
    permission: "admin",
    repository: "our-cool-repo",
    username: "SomeUser",
});

Create a RepositoryCollaborator Resource

def RepositoryCollaborator(resource_name, opts=None, permission=None, repository=None, username=None, __props__=None);
name string
The unique name of the resource.
args RepositoryCollaboratorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RepositoryCollaboratorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RepositoryCollaboratorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RepositoryCollaborator Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The RepositoryCollaborator resource accepts the following input properties:

Repository string

The GitHub repository

Username string

The user to add to the repository as a collaborator.

Permission string

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

Repository string

The GitHub repository

Username string

The user to add to the repository as a collaborator.

Permission string

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

repository string

The GitHub repository

username string

The user to add to the repository as a collaborator.

permission string

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

repository str

The GitHub repository

username str

The user to add to the repository as a collaborator.

permission str

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

Outputs

All input properties are implicitly available as output properties. Additionally, the RepositoryCollaborator resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
InvitationId string

ID of the invitation to be used in github..UserInvitationAccepter

Id string
The provider-assigned unique ID for this managed resource.
InvitationId string

ID of the invitation to be used in github..UserInvitationAccepter

id string
The provider-assigned unique ID for this managed resource.
invitationId string

ID of the invitation to be used in github..UserInvitationAccepter

id str
The provider-assigned unique ID for this managed resource.
invitation_id str

ID of the invitation to be used in github..UserInvitationAccepter

Look up an Existing RepositoryCollaborator Resource

Get an existing RepositoryCollaborator resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

static get(resource_name, id, opts=None, invitation_id=None, permission=None, repository=None, username=None, __props__=None);
func GetRepositoryCollaborator(ctx *Context, name string, id IDInput, state *RepositoryCollaboratorState, opts ...ResourceOption) (*RepositoryCollaborator, error)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

InvitationId string

ID of the invitation to be used in github..UserInvitationAccepter

Permission string

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

Repository string

The GitHub repository

Username string

The user to add to the repository as a collaborator.

InvitationId string

ID of the invitation to be used in github..UserInvitationAccepter

Permission string

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

Repository string

The GitHub repository

Username string

The user to add to the repository as a collaborator.

invitationId string

ID of the invitation to be used in github..UserInvitationAccepter

permission string

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

repository string

The GitHub repository

username string

The user to add to the repository as a collaborator.

invitation_id str

ID of the invitation to be used in github..UserInvitationAccepter

permission str

The permission of the outside collaborator for the repository. Must be one of pull, push, maintain, triage or admin for organization-owned repositories. Must be push for personal repositories. Defaults to push.

repository str

The GitHub repository

username str

The user to add to the repository as a collaborator.

Package Details

Repository
https://github.com/pulumi/pulumi-github
License
Apache-2.0
Notes
This Pulumi package is based on the github Terraform Provider.