Learn R Programming

multideploy (version 0.1.0)

repos: List repositories for a user or organization

Description

This function fetches repository information from GitHub for a specified user or organization, with options to filter and limit the results.

Usage

repos(
  owner,
  type = "owner",
  per_page = 100,
  max_pages = 10,
  filter_regex = NULL,
  quiet = FALSE
)

Value

Returns a data.frame of repositories with the following columns:

name

Character, repository name without owner prefix

full_name

Character, complete repository identifier (owner/repo)

default_branch

Character, the name of the default branch (e.g., "main" or "master")

private

Logical, TRUE if repository is private, FALSE if public

Arguments

owner

Character string specifying the GitHub username or organization name

type

Character string specifying the type of repositories to list: "all", "owner", "public", "private", or "member". Default is "owner".

per_page

Number of repositories to return per page. Default is 100.

max_pages

Maximum number of pages to retrieve. Default is 10.

filter_regex

Optional regular expression to filter repositories by name

quiet

Logical; if TRUE, suppresses progress and status messages. Default is FALSE.

Examples

Run this code
if (FALSE) { # interactive()
# Get all repositories owned by a user
user_repos <- repos("username")

# Get only public repositories for an organization
org_public_repos <- repos("orgname", type = "public")

# Filter repositories by name pattern
api_repos <- repos("orgname", filter_regex = "^api-")

# Limit the number of fetched repositories
limited_repos <- repos("large-org", per_page = 50, max_pages = 2)
}

Run the code above in your browser using DataLab