module Octokit::Client::Repositories

Overview

Methods for the Repositories API

See Also:

Direct including types

Defined in:

octokit/client/repositories.cr

Instance Method Summary

Instance Method Detail

def 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")

[View source]
def 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...")

[View source]
def all_repositories(**options) #

List all repositories.

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

See Also:


[View source]
def branch(repo, branch) #

Get a single branch from a repository.

Aliases: get_branch

See Also:

Example:

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

[View source]
def branch_protection(repo, branch) #

Get branch protection summary.

Note: Requires authenticated client

See Also:

Example:

@client.branch_protection("watzon/cadmium", "master")

[View source]
def 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")

[View source]
def 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")

[View source]
def 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")

[View source]
def 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")

[View source]
def 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")

[View source]
def create_repository(repo, organization = nil, **options) #

Create a repository for a user or organization.

Aliases: create, create_repo

See Also:


[View source]
def delete_repository(repo) #

Delete a repository.

Aliases: delete_repo

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

See Also:


[View source]
def delete_subscription(repo, **options) #

Delete a repository subscription.

See Also:

Example:

@client.delete_subscription("watzon/cadmium")

[View source]
def deploy_key(repo, id) #

Get a single deploy key for a repo.

See Also:

Example:

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

[View source]
def deploy_keys(repo) #

Get deploy keys on a repo.

Requires authenticated client.

Aliases:

Example:

@client.deploy_keys("watzon/cadmium")

[View source]
def 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:


[View source]
def fork(repo) #

[View source]
def 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")

[View source]
def 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")

[View source]
def 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")

[View source]
def 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")

[View source]
def 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")

[View source]
def 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)

[View source]
def 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)

[View source]
def 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:


[View source]
def repository(path) #

[View source]
def repository?(repo) #

Check if a repository exists.

See Also:


[View source]
def 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")

[View source]
def 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")

[View source]
def set_private(repo) #

Hide a public repository.

This is a convenience method that uses #update_repository


[View source]
def set_public(repo) #

Unhide a private repository.

This is a convenience method that uses #update_repository


[View source]
def star(repo) #

[View source]
def 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")

[View source]
def subscribers(repo) #

List watchers subscribing to notifications for a repo.

See Also:

Example:

@client.subscribers("watzon/cadmium")

[View source]
def subscription(repo) #

Get a repository subscription.

See Also:

Example:

@client.subscription("watzon/cadmium")

[View source]
def tags(repo) #

List tags

Note: Requires authenticated client for private repos.

See Also:

Examples:

Octokit.client.tags("watzon/cadmium")
@client.tags("watzon/cadmium")

[View source]
def 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")

[View source]
def transfer_repository(repo, new_owner, team_ids : Array(Int32)) #

Transfer a repository.

Transfer a repository owned by your organization.

Aliases: transfer_repo

See Also:


[View source]
def unprotect_branch(repo, branch) #

Unlock a single branch from a repository.

Note: Requires authenticated client

See Also:

Example:

@client.unprotect_branch("watzon/cadmium", "master")

[View source]
def unstar(repo) #

[View source]
def unwatch(repo) #

[View source]
def update_subscription(repo, **options) #

Update a repository subscription.

See Also:

Example:

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

[View source]
def watch(repo) #

[View source]