RepositoryArgs

data class RepositoryArgs(val allowAutoMerge: Output<Boolean>? = null, val allowMergeCommit: Output<Boolean>? = null, val allowRebaseMerge: Output<Boolean>? = null, val allowSquashMerge: Output<Boolean>? = null, val allowUpdateBranch: Output<Boolean>? = null, val archiveOnDestroy: Output<Boolean>? = null, val archived: Output<Boolean>? = null, val autoInit: Output<Boolean>? = null, val defaultBranch: Output<String>? = null, val deleteBranchOnMerge: Output<Boolean>? = null, val description: Output<String>? = null, val gitignoreTemplate: Output<String>? = null, val hasDiscussions: Output<Boolean>? = null, val hasDownloads: Output<Boolean>? = null, val hasIssues: Output<Boolean>? = null, val hasProjects: Output<Boolean>? = null, val hasWiki: Output<Boolean>? = null, val homepageUrl: Output<String>? = null, val ignoreVulnerabilityAlertsDuringRead: Output<Boolean>? = null, val isTemplate: Output<Boolean>? = null, val licenseTemplate: Output<String>? = null, val mergeCommitMessage: Output<String>? = null, val mergeCommitTitle: Output<String>? = null, val name: Output<String>? = null, val pages: Output<RepositoryPagesArgs>? = null, val private: Output<Boolean>? = null, val securityAndAnalysis: Output<RepositorySecurityAndAnalysisArgs>? = null, val squashMergeCommitMessage: Output<String>? = null, val squashMergeCommitTitle: Output<String>? = null, val template: Output<RepositoryTemplateArgs>? = null, val topics: Output<List<String>>? = null, val visibility: Output<String>? = null, val vulnerabilityAlerts: Output<Boolean>? = null, val webCommitSignoffRequired: Output<Boolean>? = null) : ConvertibleToJava<RepositoryArgs>

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 or else the allow_merge_commit, allow_rebase_merge, and allow_squash_merge attributes will be ignored, causing confusing diffs.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.inputs.RepositoryTemplateArgs;
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) {
var example = new Repository("example", RepositoryArgs.builder()
.description("My awesome codebase")
.template(RepositoryTemplateArgs.builder()
.includeAllBranches(true)
.owner("github")
.repository("terraform-template-module")
.build())
.visibility("public")
.build());
}
}

With GitHub Pages Enabled

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.inputs.RepositoryPagesArgs;
import com.pulumi.github.inputs.RepositoryPagesSourceArgs;
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) {
var example = new Repository("example", RepositoryArgs.builder()
.description("My awesome web page")
.pages(RepositoryPagesArgs.builder()
.source(RepositoryPagesSourceArgs.builder()
.branch("master")
.path("/docs")
.build())
.build())
.private_(false)
.build());
}
}

Import

Repositories can be imported using the name, e.g.

$ pulumi import github:index/repository:Repository terraform terraform

Constructors

Link copied to clipboard
constructor(allowAutoMerge: Output<Boolean>? = null, allowMergeCommit: Output<Boolean>? = null, allowRebaseMerge: Output<Boolean>? = null, allowSquashMerge: Output<Boolean>? = null, allowUpdateBranch: Output<Boolean>? = null, archiveOnDestroy: Output<Boolean>? = null, archived: Output<Boolean>? = null, autoInit: Output<Boolean>? = null, defaultBranch: Output<String>? = null, deleteBranchOnMerge: Output<Boolean>? = null, description: Output<String>? = null, gitignoreTemplate: Output<String>? = null, hasDiscussions: Output<Boolean>? = null, hasDownloads: Output<Boolean>? = null, hasIssues: Output<Boolean>? = null, hasProjects: Output<Boolean>? = null, hasWiki: Output<Boolean>? = null, homepageUrl: Output<String>? = null, ignoreVulnerabilityAlertsDuringRead: Output<Boolean>? = null, isTemplate: Output<Boolean>? = null, licenseTemplate: Output<String>? = null, mergeCommitMessage: Output<String>? = null, mergeCommitTitle: Output<String>? = null, name: Output<String>? = null, pages: Output<RepositoryPagesArgs>? = null, private: Output<Boolean>? = null, securityAndAnalysis: Output<RepositorySecurityAndAnalysisArgs>? = null, squashMergeCommitMessage: Output<String>? = null, squashMergeCommitTitle: Output<String>? = null, template: Output<RepositoryTemplateArgs>? = null, topics: Output<List<String>>? = null, visibility: Output<String>? = null, vulnerabilityAlerts: Output<Boolean>? = null, webCommitSignoffRequired: Output<Boolean>? = null)

Properties

Link copied to clipboard
val allowAutoMerge: Output<Boolean>? = null

Set to true to allow auto-merging pull requests on the repository.

Link copied to clipboard
val allowMergeCommit: Output<Boolean>? = null

Set to false to disable merge commits on the repository.

Link copied to clipboard
val allowRebaseMerge: Output<Boolean>? = null

Set to false to disable rebase merges on the repository.

Link copied to clipboard
val allowSquashMerge: Output<Boolean>? = null

Set to false to disable squash merges on the repository.

Link copied to clipboard
val allowUpdateBranch: Output<Boolean>? = null

Set to true to always suggest updating pull request branches.

Link copied to clipboard
val archived: Output<Boolean>? = null

Specifies if the repository should be archived. Defaults to false. NOTE Currently, the API does not support unarchiving.

Link copied to clipboard
val archiveOnDestroy: Output<Boolean>? = null

Set to true to archive the repository instead of deleting on destroy.

Link copied to clipboard
val autoInit: Output<Boolean>? = null

Set to true to produce an initial commit in the repository.

Link copied to clipboard
val defaultBranch: Output<String>? = null

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

Link copied to clipboard
val deleteBranchOnMerge: Output<Boolean>? = null

Automatically delete head branch after a pull request is merged. Defaults to false.

Link copied to clipboard
val description: Output<String>? = null

A description of the repository.

Link copied to clipboard
val gitignoreTemplate: Output<String>? = null

Use the name of the template without the extension. For example, "Haskell".

Link copied to clipboard
val hasDiscussions: Output<Boolean>? = null

Set to true to enable GitHub Discussions on the repository. Defaults to false.

Link copied to clipboard
val hasDownloads: Output<Boolean>? = null

Set to true to enable the (deprecated) downloads features on the repository.

Link copied to clipboard
val hasIssues: Output<Boolean>? = null

Set to true to enable the GitHub Issues features on the repository.

Link copied to clipboard
val hasProjects: Output<Boolean>? = null

Set to true to enable the GitHub Projects features on the repository. Per the GitHub documentation 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.

Link copied to clipboard
val hasWiki: Output<Boolean>? = null

Set to true to enable the GitHub Wiki features on the repository.

Link copied to clipboard
val homepageUrl: Output<String>? = null

URL of a page describing the project.

Link copied to clipboard

Set to true to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read.

Link copied to clipboard
val isTemplate: Output<Boolean>? = null

Set to true to tell GitHub that this is a template repository.

Link copied to clipboard
val licenseTemplate: Output<String>? = null

Use the name of the template without the extension. For example, "mit" or "mpl-2.0".

Link copied to clipboard
val mergeCommitMessage: Output<String>? = null

Can be PR_BODY, PR_TITLE, or BLANK for a default merge commit message. Applicable only if allow_merge_commit is true.

Link copied to clipboard
val mergeCommitTitle: Output<String>? = null

Can be PR_TITLE or MERGE_MESSAGE for a default merge commit title. Applicable only if allow_merge_commit is true.

Link copied to clipboard
val name: Output<String>? = null

The name of the repository.

Link copied to clipboard
val pages: Output<RepositoryPagesArgs>? = null

The repository's GitHub Pages configuration. See GitHub Pages Configuration below for details.

Link copied to clipboard
val private: Output<Boolean>? = null

Set to true to create a private repository. Repositories are created as public (e.g. open source) by default.

Link copied to clipboard

The repository's security and analysis configuration. See Security and Analysis Configuration below for details.

Link copied to clipboard
val squashMergeCommitMessage: Output<String>? = null

Can be PR_BODY, COMMIT_MESSAGES, or BLANK for a default squash merge commit message. Applicable only if allow_squash_merge is true.

Link copied to clipboard
val squashMergeCommitTitle: Output<String>? = null

Can be PR_TITLE or COMMIT_OR_PR_TITLE for a default squash merge commit title. Applicable only if allow_squash_merge is true.

Link copied to clipboard
val template: Output<RepositoryTemplateArgs>? = null

Use a template repository to create this resource. See Template Repositories below for details.

Link copied to clipboard
val topics: Output<List<String>>? = null

The list of topics of the repository.

Link copied to clipboard
val visibility: Output<String>? = null

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.

Link copied to clipboard
val vulnerabilityAlerts: Output<Boolean>? = null

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 for details. Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings.

Link copied to clipboard
val webCommitSignoffRequired: Output<Boolean>? = null

Require contributors to sign off on web-based commits. See more here. Defaults to false.

Functions

Link copied to clipboard
open override fun toJava(): RepositoryArgs