module

Octokit::Client::Repositories

Methods for the Repositories API

See Also:

Instance methods

add_collaborator(repo, collaborator, **options)

Add collaborator to a repo.

This can be used to update the permissions of an existing collaborator.

Aliases: add_collab

Note: Requires authenticated client.

See Also:

Examples:

Add a new collaborator

@client.add_collaborator("watzon/cadmium", "asterite")

Update permissions for a collaborator

@client.add_collaborator("watzon/cadmium", "asterite", permisson: "admin")
Source
add_deploy_key(repo, title, key, read_only = false)

Add deploy key to a repo.

Requires authenticated client.

See Also:

Example:

@client.deploy_key("watzon/cadmium", "Staging server", "ssh-rsa AAA...")
Source
all_repositories

List all repositories.

This provides a dump of every public repository on Github, in the order that they were created.

See Also:

Source
branch(repo, branch)

Get a single branch from a repository.

Aliases: get_branch

See Also:

Example:

Octokit.client.branch("watzon/cadmium", "master")
Source
branch_protection(repo, branch)

Get branch protection summary.

Note: Requires authenticated client

See Also:

Example:

@client.branch_protection("watzon/cadmium", "master")
Source
branches(repo, get_protected = false)

List branches

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.branches("watzon/cadmium")
@client.branches("watzon/cadmium")
Source
check_assignee(repo, assignee)

Check to see if a particular user is an assignee for a repository.

See Also:

Example:

Octokit.client.repository_assignees("watzon/cadmium")
Source
collaborator?(repo, collaborator)

Check if a user is a collaborator for a repo

Note: Requires authenticated client.

See Also:

Example:

@client.collaborator?("watzon/cadmium", "asterite")
Source
collaborators(repo, affiliation = :all)

List collaborators.

Aliases: collabs

Note: Requires authenticated client for private repos.

See Also:

Examples:

With unauthenticated client

Octokit.client.collaborators("watzon/cadmium")

With authenticated client

@client.collaborators("watzon/cadmium")
Source
contributors(repo, anon = false)

List contributors to a repo.

Aliases: contribs

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.contributors("watzon/cadmium", true)
@client.contribs("watzon/cadmium")
Source
create_repository(repo, organization = nil, **options)

Create a repository for a user or organization.

Aliases: create, create_repo

See Also:

Source
delete_repository(repo)

Delete a repository.

Aliases: delete_repo

Note: If OAuth is used, 'delete_repo' scope is required.

See Also:

Source
delete_subscription(repo, **options)

Delete a repository subscription.

See Also:

Example:

@client.delete_subscription("watzon/cadmium")
Source
deploy_key(repo, id)

Get a single deploy key for a repo.

See Also:

Example:

@client.deploy_key("watzon/cadmium", 7729435)
Source
deploy_keys(repo)

Get deploy keys on a repo.

Requires authenticated client.

Aliases:

Example:

@client.deploy_keys("watzon/cadmium")
Source
edit_repository(repo : String | Repository, **options)

Edit a repository.

Example:

@client.edit_repository("watzon/cadmium", has_wiki: true)

Available edit options are stored in Octokit::Models::CreateRepoRequest

Aliases: edit, update, update

See Also:

Source
forks(repo, sort = "newest")

List forks

Aliases: network

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.forks("watzon/cadmium")
@client.forks("watzon/cadmium", sort: "oldest")
Source
languages(repo)

List programming languages in the repo.

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.languages("watzon/cadmium")
@client.languages("watzon/cadmium", sort: "oldest")
Source
permission_level(repo, collaborator)

Get a user's permission level for a repo.

Note: Requires authenticated client.

See Also:

Example:

@client.permission_level("watzon/cadmium", "asterite")
Source
protect_branch(repo, branch, **options)

Lock a single branch from a repository.

Note: Requires authenticated client

See Also:

Example:

@client.protect_branch("watzon/cadmium", "master")
Source
remove_collaborator(repo, collaborator)

Remove collaborator from a repo.

Aliases: remove_collab

Note: Requires authenticated client.

See Also:

Example:

@client.remove_collaborator("watzon/cadmium", "asterite")
Source
remove_deploy_key(repo, id)

Remove a deploy key from a repo.

Note: Requires authenticated client.

See Also:

Example:

@client.remove_deploy_key("watzon/cadmium", 7729435)
Source
replace_all_topics(repo, names)

Replace all topics for a repository.

Note: Requires authenticated client.

See Also:

Examples:

Replace all topics

@client.replace_all_topics("watzon/cadmium", ["element", "nlp", "crystal", "awesome"])

Clear all topics

@client.replace_all_topics("watzon/cadmium", nil)
Source
repositories(user = nil, **options)

List user repositories.

If user is not supplied, repositories for the current authenticated user are returned.

Aliases: list_repositories, list_repos, repos

Note: If the user provided is a GitHub organization, only the organization's public repositories will be listed. For retrieving organization repositories the Organizations#organization_repositories method should be used instead.

See Also:

Source
repository?(repo)

Check if a repository exists.

See Also:

Source
repository_assignees(repo)

List users available for assigning issues.

Aliases: repo_assignees

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.repository_assignees("watzon/cadmium")
@client.repository_assignees("watzon/cadmium")
Source
repository_teams(repo)

List teams for a repo.

Aliases: repo_teams, teams

Note: Requires authenticated client that is an owner or collaborator of the repo.

See Also:

Example:

@client.repository_teams("watzon/cadmium")
Source
set_private(repo)

Hide a public repository.

This is a convenience method that uses #update_repository

Source
set_public(repo)

Unhide a private repository.

This is a convenience method that uses #update_repository

Source
stargazers(repo)

List stargazers of a repo.

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.stargazers("watzon/cadmium")
@client.stargazers("watzon/cadmium")
Source
subscribers(repo)

List watchers subscribing to notifications for a repo.

See Also:

Example:

@client.subscribers("watzon/cadmium")
Source
subscription(repo)

Get a repository subscription.

See Also:

Example:

@client.subscription("watzon/cadmium")
Source
tags(repo)

List tags

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.tags("watzon/cadmium")
@client.tags("watzon/cadmium")
Source
topics(repo)

List all topics for a repository.

Note: Requires authenticated client that is an owner or collaborator of the repo.

See Also:

Example:

@client.topics("watzon/cadmium")
Source
transfer_repository(repo, new_owner, team_ids : Array(Int32))

Transfer a repository.

Transfer a repository owned by your organization.

Aliases: transfer_repo

See Also:

Source
unprotect_branch(repo, branch)

Unlock a single branch from a repository.

Note: Requires authenticated client

See Also:

Example:

@client.unprotect_branch("watzon/cadmium", "master")
Source
update_subscription(repo, **options)

Update a repository subscription.

See Also:

Example:

@client.update_subscription("watzon/cadmium", subscribed: true)
Source