Repository Collaborator Args
Provides a GitHub repository collaborator resource.
Note: github.RepositoryCollaborator cannot be used in conjunction with github.RepositoryCollaborators or they will fight over what your policy should be. 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.RepositoryCollaborators instead. Further documentation on GitHub collaborators:
Adding outside collaborators to repositories in your organization
Converting an organization member to an outside collaborator
Example Usage
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", {
repository: "our-cool-repo",
username: "SomeUser",
permission: "admin",
});
import pulumi
import pulumi_github as github
# Add a collaborator to a repository
a_repo_collaborator = github.RepositoryCollaborator("a_repo_collaborator",
repository="our-cool-repo",
username="SomeUser",
permission="admin")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
// Add a collaborator to a repository
var aRepoCollaborator = new Github.RepositoryCollaborator("a_repo_collaborator", new()
{
Repository = "our-cool-repo",
Username = "SomeUser",
Permission = "admin",
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Add a collaborator to a repository
_, err := github.NewRepositoryCollaborator(ctx, "a_repo_collaborator", &github.RepositoryCollaboratorArgs{
Repository: pulumi.String("our-cool-repo"),
Username: pulumi.String("SomeUser"),
Permission: pulumi.String("admin"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.RepositoryCollaborator;
import com.pulumi.github.RepositoryCollaboratorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Add a collaborator to a repository
var aRepoCollaborator = new RepositoryCollaborator("aRepoCollaborator", RepositoryCollaboratorArgs.builder()
.repository("our-cool-repo")
.username("SomeUser")
.permission("admin")
.build());
}
}
resources:
# Add a collaborator to a repository
aRepoCollaborator:
type: github:RepositoryCollaborator
name: a_repo_collaborator
properties:
repository: our-cool-repo
username: SomeUser
permission: admin
Import
GitHub Repository Collaborators can be imported using an ID made up of repository:username
, e.g.
$ pulumi import github:index/repositoryCollaborator:RepositoryCollaborator collaborator terraform:someuser
Properties
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
.
Suppress plan diffs for triage
and maintain
. Defaults to false
.
The GitHub repository