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:
- Adding outside collaborators to your personal repositories
- Adding outside collaborators to repositories in your organization
- Converting an organization member to an outside collaborator
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
new RepositoryCollaborator(name: string, args: RepositoryCollaboratorArgs, opts?: CustomResourceOptions);def RepositoryCollaborator(resource_name, opts=None, permission=None, repository=None, username=None, __props__=None);func NewRepositoryCollaborator(ctx *Context, name string, args RepositoryCollaboratorArgs, opts ...ResourceOption) (*RepositoryCollaborator, error)public RepositoryCollaborator(string name, RepositoryCollaboratorArgs args, CustomResourceOptions? opts = null)- 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.
- 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.
- 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.
- 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.
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.
- Invitation
Id string ID of the invitation to be used in
github..UserInvitationAccepter
- Id string
- The provider-assigned unique ID for this managed resource.
- Invitation
Id string ID of the invitation to be used in
github..UserInvitationAccepter
- id string
- The provider-assigned unique ID for this managed resource.
- invitation
Id 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.
public static get(name: string, id: Input<ID>, state?: RepositoryCollaboratorState, opts?: CustomResourceOptions): RepositoryCollaboratorstatic 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)public static RepositoryCollaborator Get(string name, Input<string> id, RepositoryCollaboratorState? state, CustomResourceOptions? opts = null)- 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:
- Invitation
Id 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.- Repository string
The GitHub repository
- Username string
The user to add to the repository as a collaborator.
- Invitation
Id 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.- Repository string
The GitHub repository
- Username string
The user to add to the repository as a collaborator.
- invitation
Id 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.- 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,triageoradminfor organization-owned repositories. Must bepushfor personal repositories. Defaults topush.- 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
githubTerraform Provider.