import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * This resource allows you to create and manage repositories within your * GitHub organization or personal account. * * > **Note** When used with GitHub App authentication, even GET requests must have the `contents:write` permission. Without it, the following arguments will be ignored, leading to unexpected behavior and confusing diffs: `allowMergeCommit`, `allowSquashMerge`, `allowRebaseMerge`, `mergeCommitTitle`, `mergeCommitMessage`, `squashMergeCommitTitle` and `squashMergeCommitMessage`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const example = new github.Repository("example", { * name: "example", * description: "My awesome codebase", * visibility: "public", * template: { * owner: "github", * repository: "terraform-template-module", * includeAllBranches: true, * }, * }); * ``` * * ### With GitHub Pages Enabled * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const example = new github.Repository("example", { * name: "example", * description: "My awesome web page", * "private": false, * pages: { * source: { * branch: "master", * path: "/docs", * }, * }, * }); * ``` * * ## Import * * Repositories can be imported using the `name`, e.g. * * ```sh * $ pulumi import github:index/repository:Repository terraform terraform * ``` */ export declare class Repository extends pulumi.CustomResource { /** * Get an existing Repository 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?: RepositoryState, opts?: pulumi.CustomResourceOptions): Repository; /** * Returns true if the given object is an instance of Repository. 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 Repository; /** * Set to `true` to allow auto-merging pull requests on the repository. */ readonly allowAutoMerge: pulumi.Output; /** * Set to `false` to disable merge commits on the repository. */ readonly allowMergeCommit: pulumi.Output; /** * Set to `false` to disable rebase merges on the repository. */ readonly allowRebaseMerge: pulumi.Output; /** * Set to `false` to disable squash merges on the repository. */ readonly allowSquashMerge: pulumi.Output; /** * Set to `true` to always suggest updating pull request branches. */ readonly allowUpdateBranch: pulumi.Output; /** * Set to `true` to archive the repository instead of deleting on destroy. */ readonly archiveOnDestroy: pulumi.Output; /** * Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. */ readonly archived: pulumi.Output; /** * Set to `true` to produce an initial commit in the repository. */ readonly autoInit: pulumi.Output; /** * (Deprecated: Use `github.BranchDefault` resource instead) The name of the default branch of the repository. **NOTE:** This can only be set after a repository has already been created, * and after a correct reference has been created for the target branch inside the repository. This means a user will have to omit this parameter from the * initial repository creation and create the target branch inside of the repository prior to setting this attribute. * * @deprecated Use the github.BranchDefault resource instead */ readonly defaultBranch: pulumi.Output; /** * Automatically delete head branch after a pull request is merged. Defaults to `false`. */ readonly deleteBranchOnMerge: pulumi.Output; /** * A description of the repository. */ readonly description: pulumi.Output; readonly etag: pulumi.Output; /** * A string of the form "orgname/reponame". */ readonly fullName: pulumi.Output; /** * URL that can be provided to `git clone` to clone the repository anonymously via the git protocol. */ readonly gitCloneUrl: pulumi.Output; /** * Use the [name of the template](https://github.com/github/gitignore) without the extension. For example, "Haskell". */ readonly gitignoreTemplate: pulumi.Output; /** * Set to `true` to enable GitHub Discussions on the repository. Defaults to `false`. */ readonly hasDiscussions: pulumi.Output; /** * Set to `true` to enable the (deprecated) downloads features on the repository. */ readonly hasDownloads: pulumi.Output; /** * Set to `true` to enable the GitHub Issues features * on the repository. */ readonly hasIssues: pulumi.Output; /** * Set to `true` to enable the GitHub Projects features on the repository. Per the GitHub [documentation](https://developer.github.com/v3/repos/#create) when in an organization that has disabled repository projects it will default to `false` and will otherwise default to `true`. If you specify `true` when it has been disabled it will return an error. */ readonly hasProjects: pulumi.Output; /** * Set to `true` to enable the GitHub Wiki features on * the repository. */ readonly hasWiki: pulumi.Output; /** * URL of a page describing the project. */ readonly homepageUrl: pulumi.Output; /** * The absolute URL (including scheme) of the rendered GitHub Pages site e.g. `https://username.github.io`. */ readonly htmlUrl: pulumi.Output; /** * URL that can be provided to `git clone` to clone the repository via HTTPS. */ readonly httpCloneUrl: pulumi.Output; /** * Set to `true` to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read. */ readonly ignoreVulnerabilityAlertsDuringRead: pulumi.Output; /** * Set to `true` to tell GitHub that this is a template repository. */ readonly isTemplate: pulumi.Output; /** * Use the [name of the template](https://github.com/github/choosealicense.com/tree/gh-pages/_licenses) without the extension. For example, "mit" or "mpl-2.0". */ readonly licenseTemplate: pulumi.Output; /** * Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if `allowMergeCommit` is `true`. */ readonly mergeCommitMessage: pulumi.Output; /** * Can be `PR_TITLE` or `MERGE_MESSAGE` for a default merge commit title. Applicable only if `allowMergeCommit` is `true`. */ readonly mergeCommitTitle: pulumi.Output; /** * The name of the repository. */ readonly name: pulumi.Output; /** * GraphQL global node id for use with v4 API */ readonly nodeId: pulumi.Output; /** * The repository's GitHub Pages configuration. See GitHub Pages Configuration below for details. */ readonly pages: pulumi.Output; /** * The primary language used in the repository. */ readonly primaryLanguage: pulumi.Output; /** * Set to `true` to create a private repository. * Repositories are created as public (e.g. open source) by default. * * @deprecated use visibility instead */ readonly private: pulumi.Output; /** * GitHub ID for the repository */ readonly repoId: pulumi.Output; /** * The repository's [security and analysis](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository) configuration. See Security and Analysis Configuration below for details. */ readonly securityAndAnalysis: pulumi.Output; /** * Can be `PR_BODY`, `COMMIT_MESSAGES`, or `BLANK` for a default squash merge commit message. Applicable only if `allowSquashMerge` is `true`. */ readonly squashMergeCommitMessage: pulumi.Output; /** * Can be `PR_TITLE` or `COMMIT_OR_PR_TITLE` for a default squash merge commit title. Applicable only if `allowSquashMerge` is `true`. */ readonly squashMergeCommitTitle: pulumi.Output; /** * URL that can be provided to `git clone` to clone the repository via SSH. */ readonly sshCloneUrl: pulumi.Output; /** * URL that can be provided to `svn checkout` to check out the repository via GitHub's Subversion protocol emulation. */ readonly svnUrl: pulumi.Output; /** * Use a template repository to create this resource. See Template Repositories below for details. */ readonly template: pulumi.Output; /** * The list of topics of the repository. */ readonly topics: pulumi.Output; /** * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. */ readonly visibility: pulumi.Output; /** * Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings. */ readonly vulnerabilityAlerts: pulumi.Output; /** * Require contributors to sign off on web-based commits. See more [here](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-the-commit-signoff-policy-for-your-repository). Defaults to `false`. */ readonly webCommitSignoffRequired: pulumi.Output; /** * Create a Repository 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?: RepositoryArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Repository resources. */ export interface RepositoryState { /** * Set to `true` to allow auto-merging pull requests on the repository. */ allowAutoMerge?: pulumi.Input; /** * Set to `false` to disable merge commits on the repository. */ allowMergeCommit?: pulumi.Input; /** * Set to `false` to disable rebase merges on the repository. */ allowRebaseMerge?: pulumi.Input; /** * Set to `false` to disable squash merges on the repository. */ allowSquashMerge?: pulumi.Input; /** * Set to `true` to always suggest updating pull request branches. */ allowUpdateBranch?: pulumi.Input; /** * Set to `true` to archive the repository instead of deleting on destroy. */ archiveOnDestroy?: pulumi.Input; /** * Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. */ archived?: pulumi.Input; /** * Set to `true` to produce an initial commit in the repository. */ autoInit?: pulumi.Input; /** * (Deprecated: Use `github.BranchDefault` resource instead) The name of the default branch of the repository. **NOTE:** This can only be set after a repository has already been created, * and after a correct reference has been created for the target branch inside the repository. This means a user will have to omit this parameter from the * initial repository creation and create the target branch inside of the repository prior to setting this attribute. * * @deprecated Use the github.BranchDefault resource instead */ defaultBranch?: pulumi.Input; /** * Automatically delete head branch after a pull request is merged. Defaults to `false`. */ deleteBranchOnMerge?: pulumi.Input; /** * A description of the repository. */ description?: pulumi.Input; etag?: pulumi.Input; /** * A string of the form "orgname/reponame". */ fullName?: pulumi.Input; /** * URL that can be provided to `git clone` to clone the repository anonymously via the git protocol. */ gitCloneUrl?: pulumi.Input; /** * Use the [name of the template](https://github.com/github/gitignore) without the extension. For example, "Haskell". */ gitignoreTemplate?: pulumi.Input; /** * Set to `true` to enable GitHub Discussions on the repository. Defaults to `false`. */ hasDiscussions?: pulumi.Input; /** * Set to `true` to enable the (deprecated) downloads features on the repository. */ hasDownloads?: pulumi.Input; /** * Set to `true` to enable the GitHub Issues features * on the repository. */ hasIssues?: pulumi.Input; /** * Set to `true` to enable the GitHub Projects features on the repository. Per the GitHub [documentation](https://developer.github.com/v3/repos/#create) when in an organization that has disabled repository projects it will default to `false` and will otherwise default to `true`. If you specify `true` when it has been disabled it will return an error. */ hasProjects?: pulumi.Input; /** * Set to `true` to enable the GitHub Wiki features on * the repository. */ hasWiki?: pulumi.Input; /** * URL of a page describing the project. */ homepageUrl?: pulumi.Input; /** * The absolute URL (including scheme) of the rendered GitHub Pages site e.g. `https://username.github.io`. */ htmlUrl?: pulumi.Input; /** * URL that can be provided to `git clone` to clone the repository via HTTPS. */ httpCloneUrl?: pulumi.Input; /** * Set to `true` to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read. */ ignoreVulnerabilityAlertsDuringRead?: pulumi.Input; /** * Set to `true` to tell GitHub that this is a template repository. */ isTemplate?: pulumi.Input; /** * Use the [name of the template](https://github.com/github/choosealicense.com/tree/gh-pages/_licenses) without the extension. For example, "mit" or "mpl-2.0". */ licenseTemplate?: pulumi.Input; /** * Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if `allowMergeCommit` is `true`. */ mergeCommitMessage?: pulumi.Input; /** * Can be `PR_TITLE` or `MERGE_MESSAGE` for a default merge commit title. Applicable only if `allowMergeCommit` is `true`. */ mergeCommitTitle?: pulumi.Input; /** * The name of the repository. */ name?: pulumi.Input; /** * GraphQL global node id for use with v4 API */ nodeId?: pulumi.Input; /** * The repository's GitHub Pages configuration. See GitHub Pages Configuration below for details. */ pages?: pulumi.Input; /** * The primary language used in the repository. */ primaryLanguage?: pulumi.Input; /** * Set to `true` to create a private repository. * Repositories are created as public (e.g. open source) by default. * * @deprecated use visibility instead */ private?: pulumi.Input; /** * GitHub ID for the repository */ repoId?: pulumi.Input; /** * The repository's [security and analysis](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository) configuration. See Security and Analysis Configuration below for details. */ securityAndAnalysis?: pulumi.Input; /** * Can be `PR_BODY`, `COMMIT_MESSAGES`, or `BLANK` for a default squash merge commit message. Applicable only if `allowSquashMerge` is `true`. */ squashMergeCommitMessage?: pulumi.Input; /** * Can be `PR_TITLE` or `COMMIT_OR_PR_TITLE` for a default squash merge commit title. Applicable only if `allowSquashMerge` is `true`. */ squashMergeCommitTitle?: pulumi.Input; /** * URL that can be provided to `git clone` to clone the repository via SSH. */ sshCloneUrl?: pulumi.Input; /** * URL that can be provided to `svn checkout` to check out the repository via GitHub's Subversion protocol emulation. */ svnUrl?: pulumi.Input; /** * Use a template repository to create this resource. See Template Repositories below for details. */ template?: pulumi.Input; /** * The list of topics of the repository. */ topics?: pulumi.Input[]>; /** * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. */ visibility?: pulumi.Input; /** * Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings. */ vulnerabilityAlerts?: pulumi.Input; /** * Require contributors to sign off on web-based commits. See more [here](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-the-commit-signoff-policy-for-your-repository). Defaults to `false`. */ webCommitSignoffRequired?: pulumi.Input; } /** * The set of arguments for constructing a Repository resource. */ export interface RepositoryArgs { /** * Set to `true` to allow auto-merging pull requests on the repository. */ allowAutoMerge?: pulumi.Input; /** * Set to `false` to disable merge commits on the repository. */ allowMergeCommit?: pulumi.Input; /** * Set to `false` to disable rebase merges on the repository. */ allowRebaseMerge?: pulumi.Input; /** * Set to `false` to disable squash merges on the repository. */ allowSquashMerge?: pulumi.Input; /** * Set to `true` to always suggest updating pull request branches. */ allowUpdateBranch?: pulumi.Input; /** * Set to `true` to archive the repository instead of deleting on destroy. */ archiveOnDestroy?: pulumi.Input; /** * Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. */ archived?: pulumi.Input; /** * Set to `true` to produce an initial commit in the repository. */ autoInit?: pulumi.Input; /** * (Deprecated: Use `github.BranchDefault` resource instead) The name of the default branch of the repository. **NOTE:** This can only be set after a repository has already been created, * and after a correct reference has been created for the target branch inside the repository. This means a user will have to omit this parameter from the * initial repository creation and create the target branch inside of the repository prior to setting this attribute. * * @deprecated Use the github.BranchDefault resource instead */ defaultBranch?: pulumi.Input; /** * Automatically delete head branch after a pull request is merged. Defaults to `false`. */ deleteBranchOnMerge?: pulumi.Input; /** * A description of the repository. */ description?: pulumi.Input; /** * Use the [name of the template](https://github.com/github/gitignore) without the extension. For example, "Haskell". */ gitignoreTemplate?: pulumi.Input; /** * Set to `true` to enable GitHub Discussions on the repository. Defaults to `false`. */ hasDiscussions?: pulumi.Input; /** * Set to `true` to enable the (deprecated) downloads features on the repository. */ hasDownloads?: pulumi.Input; /** * Set to `true` to enable the GitHub Issues features * on the repository. */ hasIssues?: pulumi.Input; /** * Set to `true` to enable the GitHub Projects features on the repository. Per the GitHub [documentation](https://developer.github.com/v3/repos/#create) when in an organization that has disabled repository projects it will default to `false` and will otherwise default to `true`. If you specify `true` when it has been disabled it will return an error. */ hasProjects?: pulumi.Input; /** * Set to `true` to enable the GitHub Wiki features on * the repository. */ hasWiki?: pulumi.Input; /** * URL of a page describing the project. */ homepageUrl?: pulumi.Input; /** * Set to `true` to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read. */ ignoreVulnerabilityAlertsDuringRead?: pulumi.Input; /** * Set to `true` to tell GitHub that this is a template repository. */ isTemplate?: pulumi.Input; /** * Use the [name of the template](https://github.com/github/choosealicense.com/tree/gh-pages/_licenses) without the extension. For example, "mit" or "mpl-2.0". */ licenseTemplate?: pulumi.Input; /** * Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if `allowMergeCommit` is `true`. */ mergeCommitMessage?: pulumi.Input; /** * Can be `PR_TITLE` or `MERGE_MESSAGE` for a default merge commit title. Applicable only if `allowMergeCommit` is `true`. */ mergeCommitTitle?: pulumi.Input; /** * The name of the repository. */ name?: pulumi.Input; /** * The repository's GitHub Pages configuration. See GitHub Pages Configuration below for details. */ pages?: pulumi.Input; /** * Set to `true` to create a private repository. * Repositories are created as public (e.g. open source) by default. * * @deprecated use visibility instead */ private?: pulumi.Input; /** * The repository's [security and analysis](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository) configuration. See Security and Analysis Configuration below for details. */ securityAndAnalysis?: pulumi.Input; /** * Can be `PR_BODY`, `COMMIT_MESSAGES`, or `BLANK` for a default squash merge commit message. Applicable only if `allowSquashMerge` is `true`. */ squashMergeCommitMessage?: pulumi.Input; /** * Can be `PR_TITLE` or `COMMIT_OR_PR_TITLE` for a default squash merge commit title. Applicable only if `allowSquashMerge` is `true`. */ squashMergeCommitTitle?: pulumi.Input; /** * Use a template repository to create this resource. See Template Repositories below for details. */ template?: pulumi.Input; /** * The list of topics of the repository. */ topics?: pulumi.Input[]>; /** * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. */ visibility?: pulumi.Input; /** * Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings. */ vulnerabilityAlerts?: pulumi.Input; /** * Require contributors to sign off on web-based commits. See more [here](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-the-commit-signoff-policy-for-your-repository). Defaults to `false`. */ webCommitSignoffRequired?: pulumi.Input; }