import * as pulumi from "@pulumi/pulumi"; /** * 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. * * > **Note on Archived Repositories**: When a repository is archived, GitHub makes it read-only, preventing collaborator modifications. If you attempt to destroy resources associated with archived repositories, the provider will gracefully handle the operation by logging an informational message and removing the resource from Terraform state without attempting to modify the archived 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 your personal repositories](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories) * - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) * - [Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) * * ## Example Usage * * ```typescript * 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 * * GitHub Repository Collaborators can be imported using an ID made up of `repository:username`, e.g. * * ```sh * $ pulumi import github:index/repositoryCollaborator:RepositoryCollaborator collaborator terraform:someuser * ``` */ export declare class RepositoryCollaborator extends pulumi.CustomResource { /** * Get an existing RepositoryCollaborator resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: RepositoryCollaboratorState, opts?: pulumi.CustomResourceOptions): RepositoryCollaborator; /** * Returns true if the given object is an instance of RepositoryCollaborator. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is RepositoryCollaborator; /** * ID of the invitation to be used in `github.UserInvitationAccepter` */ readonly invitationId: pulumi.Output; /** * 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](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization) within the organization for organization-owned repositories. * Must be `push` for personal repositories. Defaults to `push`. */ readonly permission: pulumi.Output; /** * Suppress plan diffs for `triage` and `maintain`. Defaults to `false`. */ readonly permissionDiffSuppression: pulumi.Output; /** * The GitHub repository * * > Note: The owner of the repository can be passed as part of the repository name e.g. `owner-org-name/repo-name`. If owner is not supplied as part of the repository name, it may also be supplied by setting the environment variable `GITHUB_OWNER`. */ readonly repository: pulumi.Output; /** * The user to add to the repository as a collaborator. */ readonly username: pulumi.Output; /** * Create a RepositoryCollaborator resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RepositoryCollaboratorArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RepositoryCollaborator resources. */ export interface RepositoryCollaboratorState { /** * ID of the invitation to be used in `github.UserInvitationAccepter` */ invitationId?: pulumi.Input; /** * 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](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization) within the organization for organization-owned repositories. * Must be `push` for personal repositories. Defaults to `push`. */ permission?: pulumi.Input; /** * Suppress plan diffs for `triage` and `maintain`. Defaults to `false`. */ permissionDiffSuppression?: pulumi.Input; /** * The GitHub repository * * > Note: The owner of the repository can be passed as part of the repository name e.g. `owner-org-name/repo-name`. If owner is not supplied as part of the repository name, it may also be supplied by setting the environment variable `GITHUB_OWNER`. */ repository?: pulumi.Input; /** * The user to add to the repository as a collaborator. */ username?: pulumi.Input; } /** * The set of arguments for constructing a RepositoryCollaborator resource. */ export interface RepositoryCollaboratorArgs { /** * 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](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization) within the organization for organization-owned repositories. * Must be `push` for personal repositories. Defaults to `push`. */ permission?: pulumi.Input; /** * Suppress plan diffs for `triage` and `maintain`. Defaults to `false`. */ permissionDiffSuppression?: pulumi.Input; /** * The GitHub repository * * > Note: The owner of the repository can be passed as part of the repository name e.g. `owner-org-name/repo-name`. If owner is not supplied as part of the repository name, it may also be supplied by setting the environment variable `GITHUB_OWNER`. */ repository: pulumi.Input; /** * The user to add to the repository as a collaborator. */ username: pulumi.Input; } //# sourceMappingURL=repositoryCollaborator.d.ts.map