Repository

Create a Repository Resource

def Repository(resource_name, opts=None, allow_merge_commit=None, allow_rebase_merge=None, allow_squash_merge=None, archived=None, auto_init=None, default_branch=None, delete_branch_on_merge=None, description=None, gitignore_template=None, has_downloads=None, has_issues=None, has_projects=None, has_wiki=None, homepage_url=None, is_template=None, license_template=None, name=None, private=None, template=None, topics=None, visibility=None, __props__=None);
func NewRepository(ctx *Context, name string, args *RepositoryArgs, opts ...ResourceOption) (*Repository, error)
public Repository(string name, RepositoryArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RepositoryArgs
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 RepositoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RepositoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Repository Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Repository resource accepts the following input properties:

AllowMergeCommit bool

Set to false to disable merge commits on the repository.

AllowRebaseMerge bool

Set to false to disable rebase merges on the repository.

AllowSquashMerge bool

Set to false to disable squash merges on the repository.

Archived bool

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

AutoInit bool

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

DefaultBranch string

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.

DeleteBranchOnMerge bool

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

Description string

A description of the repository.

GitignoreTemplate string

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

HasDownloads bool

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

HasIssues bool

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

HasProjects bool

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.

HasWiki bool

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

HomepageUrl string

URL of a page describing the project.

IsTemplate bool

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

LicenseTemplate string

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

Name string

The name of the repository.

Private bool

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

Deprecated: use visibility instead

Template RepositoryTemplateArgs

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

Topics List<string>

The list of topics of the repository.

Visibility string

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.

AllowMergeCommit bool

Set to false to disable merge commits on the repository.

AllowRebaseMerge bool

Set to false to disable rebase merges on the repository.

AllowSquashMerge bool

Set to false to disable squash merges on the repository.

Archived bool

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

AutoInit bool

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

DefaultBranch string

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.

DeleteBranchOnMerge bool

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

Description string

A description of the repository.

GitignoreTemplate string

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

HasDownloads bool

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

HasIssues bool

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

HasProjects bool

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.

HasWiki bool

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

HomepageUrl string

URL of a page describing the project.

IsTemplate bool

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

LicenseTemplate string

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

Name string

The name of the repository.

Private bool

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

Deprecated: use visibility instead

Template RepositoryTemplate

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

Topics []string

The list of topics of the repository.

Visibility string

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.

allowMergeCommit boolean

Set to false to disable merge commits on the repository.

allowRebaseMerge boolean

Set to false to disable rebase merges on the repository.

allowSquashMerge boolean

Set to false to disable squash merges on the repository.

archived boolean

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

autoInit boolean

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

defaultBranch string

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.

deleteBranchOnMerge boolean

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

description string

A description of the repository.

gitignoreTemplate string

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

hasDownloads boolean

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

hasIssues boolean

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

hasProjects boolean

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.

hasWiki boolean

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

homepageUrl string

URL of a page describing the project.

isTemplate boolean

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

licenseTemplate string

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

name string

The name of the repository.

private boolean

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

Deprecated: use visibility instead

template RepositoryTemplate

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

topics string[]

The list of topics of the repository.

visibility string

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.

allow_merge_commit bool

Set to false to disable merge commits on the repository.

allow_rebase_merge bool

Set to false to disable rebase merges on the repository.

allow_squash_merge bool

Set to false to disable squash merges on the repository.

archived bool

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

auto_init bool

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

default_branch str

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.

delete_branch_on_merge bool

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

description str

A description of the repository.

gitignore_template str

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

has_downloads bool

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

has_issues bool

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

has_projects bool

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.

has_wiki bool

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

homepage_url str

URL of a page describing the project.

is_template bool

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

license_template str

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

name str

The name of the repository.

private bool

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

Deprecated: use visibility instead

template Dict[RepositoryTemplate]

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

topics List[str]

The list of topics of the repository.

visibility str

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the Repository resource produces the following output properties:

Etag string
FullName string

A string of the form “orgname/reponame”.

GitCloneUrl string

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

HtmlUrl string

URL to the repository on the web.

HttpCloneUrl string

URL that can be provided to git clone to clone the repository via HTTPS.

Id string
The provider-assigned unique ID for this managed resource.
NodeId string
SshCloneUrl string

URL that can be provided to git clone to clone the repository via SSH.

SvnUrl string

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

Etag string
FullName string

A string of the form “orgname/reponame”.

GitCloneUrl string

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

HtmlUrl string

URL to the repository on the web.

HttpCloneUrl string

URL that can be provided to git clone to clone the repository via HTTPS.

Id string
The provider-assigned unique ID for this managed resource.
NodeId string
SshCloneUrl string

URL that can be provided to git clone to clone the repository via SSH.

SvnUrl string

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

etag string
fullName string

A string of the form “orgname/reponame”.

gitCloneUrl string

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

htmlUrl string

URL to the repository on the web.

httpCloneUrl string

URL that can be provided to git clone to clone the repository via HTTPS.

id string
The provider-assigned unique ID for this managed resource.
nodeId string
sshCloneUrl string

URL that can be provided to git clone to clone the repository via SSH.

svnUrl string

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

etag str
full_name str

A string of the form “orgname/reponame”.

git_clone_url str

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

html_url str

URL to the repository on the web.

http_clone_url str

URL that can be provided to git clone to clone the repository via HTTPS.

id str
The provider-assigned unique ID for this managed resource.
node_id str
ssh_clone_url str

URL that can be provided to git clone to clone the repository via SSH.

svn_url str

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

Look up an Existing Repository Resource

Get an existing Repository 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?: RepositoryState, opts?: CustomResourceOptions): Repository
static get(resource_name, id, opts=None, allow_merge_commit=None, allow_rebase_merge=None, allow_squash_merge=None, archived=None, auto_init=None, default_branch=None, delete_branch_on_merge=None, description=None, etag=None, full_name=None, git_clone_url=None, gitignore_template=None, has_downloads=None, has_issues=None, has_projects=None, has_wiki=None, homepage_url=None, html_url=None, http_clone_url=None, is_template=None, license_template=None, name=None, node_id=None, private=None, ssh_clone_url=None, svn_url=None, template=None, topics=None, visibility=None, __props__=None);
func GetRepository(ctx *Context, name string, id IDInput, state *RepositoryState, opts ...ResourceOption) (*Repository, error)
public static Repository Get(string name, Input<string> id, RepositoryState? 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:

AllowMergeCommit bool

Set to false to disable merge commits on the repository.

AllowRebaseMerge bool

Set to false to disable rebase merges on the repository.

AllowSquashMerge bool

Set to false to disable squash merges on the repository.

Archived bool

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

AutoInit bool

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

DefaultBranch string

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.

DeleteBranchOnMerge bool

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

Description string

A description of the repository.

Etag string
FullName string

A string of the form “orgname/reponame”.

GitCloneUrl string

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

GitignoreTemplate string

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

HasDownloads bool

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

HasIssues bool

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

HasProjects bool

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.

HasWiki bool

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

HomepageUrl string

URL of a page describing the project.

HtmlUrl string

URL to the repository on the web.

HttpCloneUrl string

URL that can be provided to git clone to clone the repository via HTTPS.

IsTemplate bool

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

LicenseTemplate string

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

Name string

The name of the repository.

NodeId string
Private bool

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

Deprecated: use visibility instead

SshCloneUrl string

URL that can be provided to git clone to clone the repository via SSH.

SvnUrl string

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

Template RepositoryTemplateArgs

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

Topics List<string>

The list of topics of the repository.

Visibility string

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.

AllowMergeCommit bool

Set to false to disable merge commits on the repository.

AllowRebaseMerge bool

Set to false to disable rebase merges on the repository.

AllowSquashMerge bool

Set to false to disable squash merges on the repository.

Archived bool

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

AutoInit bool

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

DefaultBranch string

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.

DeleteBranchOnMerge bool

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

Description string

A description of the repository.

Etag string
FullName string

A string of the form “orgname/reponame”.

GitCloneUrl string

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

GitignoreTemplate string

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

HasDownloads bool

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

HasIssues bool

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

HasProjects bool

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.

HasWiki bool

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

HomepageUrl string

URL of a page describing the project.

HtmlUrl string

URL to the repository on the web.

HttpCloneUrl string

URL that can be provided to git clone to clone the repository via HTTPS.

IsTemplate bool

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

LicenseTemplate string

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

Name string

The name of the repository.

NodeId string
Private bool

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

Deprecated: use visibility instead

SshCloneUrl string

URL that can be provided to git clone to clone the repository via SSH.

SvnUrl string

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

Template RepositoryTemplate

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

Topics []string

The list of topics of the repository.

Visibility string

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.

allowMergeCommit boolean

Set to false to disable merge commits on the repository.

allowRebaseMerge boolean

Set to false to disable rebase merges on the repository.

allowSquashMerge boolean

Set to false to disable squash merges on the repository.

archived boolean

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

autoInit boolean

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

defaultBranch string

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.

deleteBranchOnMerge boolean

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

description string

A description of the repository.

etag string
fullName string

A string of the form “orgname/reponame”.

gitCloneUrl string

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

gitignoreTemplate string

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

hasDownloads boolean

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

hasIssues boolean

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

hasProjects boolean

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.

hasWiki boolean

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

homepageUrl string

URL of a page describing the project.

htmlUrl string

URL to the repository on the web.

httpCloneUrl string

URL that can be provided to git clone to clone the repository via HTTPS.

isTemplate boolean

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

licenseTemplate string

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

name string

The name of the repository.

nodeId string
private boolean

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

Deprecated: use visibility instead

sshCloneUrl string

URL that can be provided to git clone to clone the repository via SSH.

svnUrl string

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

template RepositoryTemplate

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

topics string[]

The list of topics of the repository.

visibility string

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.

allow_merge_commit bool

Set to false to disable merge commits on the repository.

allow_rebase_merge bool

Set to false to disable rebase merges on the repository.

allow_squash_merge bool

Set to false to disable squash merges on the repository.

archived bool

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

auto_init bool

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

default_branch str

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.

delete_branch_on_merge bool

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

description str

A description of the repository.

etag str
full_name str

A string of the form “orgname/reponame”.

git_clone_url str

URL that can be provided to git clone to clone the repository anonymously via the git protocol.

gitignore_template str

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

has_downloads bool

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

has_issues bool

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

has_projects bool

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.

has_wiki bool

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

homepage_url str

URL of a page describing the project.

html_url str

URL to the repository on the web.

http_clone_url str

URL that can be provided to git clone to clone the repository via HTTPS.

is_template bool

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

license_template str

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

name str

The name of the repository.

node_id str
private bool

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

Deprecated: use visibility instead

ssh_clone_url str

URL that can be provided to git clone to clone the repository via SSH.

svn_url str

URL that can be provided to svn checkout to check out the repository via GitHub’s Subversion protocol emulation.

template Dict[RepositoryTemplate]

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

topics List[str]

The list of topics of the repository.

visibility str

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.

Supporting Types

RepositoryTemplate

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Owner string
Repository string
Owner string
Repository string
owner string
repository string
owner str
repository str

Package Details

Repository
https://github.com/pulumi/pulumi-github
License
Apache-2.0
Notes
This Pulumi package is based on the github Terraform Provider.