Create, configure, clone, and open a new GitHub R package repository following rdev conventions.
Usage
create_github_repo(
repo_name,
repo_desc = "",
private = FALSE,
org = NULL,
host = getOption("rdev.host")
)Arguments
- repo_name
The name of the GitHub repository to create
- repo_desc
The description of the GitHub repository to create
- private
If
TRUE, creates a private repository.- org
The organization to create the repository in. If
NULL, create the repository in the active user's account.- host
GitHub host to target, passed to the
.api_urlargument ofgh::gh(). If unspecified, gh defaults to "https://api.github.com", although gh's default can be customised by setting the GITHUB_API_URL environment variable.For a hypothetical GitHub Enterprise instance, either "https://github.acme.com/api/v3" or "https://github.acme.com" is acceptable.
Value
return value from gh::gh() creating the repository, invisibly
Details
When run, create_github_repo():
Creates a new GitHub repository using
gh::gh()with license template fromget_license()Activates Dependabot alerts per
getOption("rdev.dependabot", default = TRUE)Activates Dependabot security updates per
getOption("rdev.dependabot", default = TRUE)Adds branch protection to the default branch (if
privateisFALSE)Clones the repository locally with
usethis::create_from_github()Creates a basic package using
usethis::create_package()If running interactively, the repository will automatically be opened in RStudio, GitHub Desktop, and the default browser
GitHub Actions
GitHub Actions can be disabled by setting rdev.github.actions to
FALSE: options(rdev.github.actions = FALSE)
Host
Set the rdev.host option when using a GitHub Enterprise server:
options(rdev.host = "https://github.example.com/api/v3")
