create_repository: Create a repository for a user or organization

Description Usage Arguments Details Value Examples

View source: R/repositories.R

Description

This function creates a new repository for the authenticated user or an organization in GitHub. It can also be used to specify whether the project is private or has issues, projects or a wiki and can define the allowed behaviour when merging pull requests.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
create_repository(
  name,
  org,
  description,
  homepage,
  private = FALSE,
  has_issues = TRUE,
  has_projects = TRUE,
  has_wiki = TRUE,
  auto_init = FALSE,
  allow_squash_merge = TRUE,
  allow_merge_commit = TRUE,
  allow_rebase_merge = TRUE,
  delete_branch_on_merge = FALSE,
  ...
)

Arguments

name

(string) The name of the repository.

org

(string, optional) The name of the organization.

description

(string, optional) A short description of the repository.

homepage

(string, optional) A URL with more information about the repository.

private

(boolean, optional) Whether the repository is private or public. Default: FALSE.

has_issues

(boolean, optional) Whether to enable issues for the repository. Default: TRUE.

has_projects

(boolean, optional) Whether to enable projects for the repository. Default: TRUE.

has_wiki

(boolean, optional) Whether to enable the wiki for the repository. Default: TRUE.

auto_init

(boolean, optional) Whether to create an initial commit with empty README. Default: FALSE.

allow_squash_merge

(boolean, optional) Whether to allow squash-merging pull requests. Default: TRUE.

allow_merge_commit

(boolean, optional) Whether to allow merging pull requests with a merge commit. Default: TRUE.

allow_rebase_merge

(boolean, optional) Whether to allow rebase-merging pull requests. Default: TRUE.

delete_branch_on_merge

(boolean, optional) Whether to allow automatically deleting branches when pull requests are merged. Default: FALSE.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

create_repository() returns a list of the repository's properties.

Repository Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

  create_repository(
    name        = "user-repository",
    description = "This is a user repository",
    homepage    = "https://user-repository.com"
  )

  create_repository(
    name        = "org-repository",
    org         = "HairyCoos",
    description = "This is a organization repository",
    homepage    = "https://org-repository.com"
  )


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.