This function constructs a list of needed information to send API calls to a specific GitHub repository. Specifically, it stores information on the repository's name and owner, the type (whether or not Enterprise GitHub), and potentially credentials to authenticate.

create_repo_ref(
  repo_owner,
  repo_name,
  is_enterprise = FALSE,
  hostname = "",
  identifier = ""
)

Arguments

repo_owner

Repository owner's username or GitHub Organization name

repo_name

Repository name

is_enterprise

Boolean denoting whether or not working with Enterprise GitHub.Defaults to FALSE

hostname

Host URL stub for Enterprise repositories (e.g. "mycorp.github.com")

identifier

Ideally should be left blank and defaults to using GITHUB_PAT or GITHUB_ENT_PAT environment variables as Personal Access Tokens. If identifier, this is assumed to be an alternative name of the environment variable to use for your Personal Access Token

Value

List of repository reference information and credentials

Details

Note that this package can be used for GET requests on public repositories without any authentication (resulting in a lower rate limit.) To do this, simply pass any string into identifier that is not an environment variable already defined for your system (e.g. accessible through Sys.getenv("MY_VAR"))

Examples

if (FALSE) { myrepo <- create_repo_ref('emilyriederer', 'myrepo') }