github-0.5.0: Access to the Github API, v3.

Safe HaskellNone

Github.Repos

Contents

Description

The Github Repos API, as documented at http://developer.github.com/v3/repos/

Synopsis

Querying repositories

userRepos :: String -> RepoPublicity -> IO (Either Error [Repo])Source

The repos for a user, by their login. Can be restricted to just repos they own, are a member of, or publicize. Private repos are currently not supported.

 userRepos "mike-burns" All

userRepo :: String -> String -> IO (Either Error Repo)Source

Details on a specific repo, given the owner and repo name.

 userRepo "mike-burns" "github"

organizationRepos :: String -> IO (Either Error [Repo])Source

The repos for an organization, by the organization name.

 organizationRepos "thoughtbot"

organizationRepo :: String -> String -> IO (Either Error Repo)Source

A specific organization repo, by the organization name.

 organizationRepo "thoughtbot" "github"

contributors :: String -> String -> IO (Either Error [Contributor])Source

The contributors to a repo, given the owner and repo name.

 contributors "thoughtbot" "paperclip"

contributorsWithAnonymous :: String -> String -> IO (Either Error [Contributor])Source

The contributors to a repo, including anonymous contributors (such as deleted users or git commits with unknown email addresses), given the owner and repo name.

 contributorsWithAnonymous "thoughtbot" "paperclip"

languagesFor :: String -> String -> IO (Either Error [Language])Source

The programming languages used in a repo along with the number of characters written in that language. Takes the repo owner and name.

 languagesFor "mike-burns" "ohlaunch"

tagsFor :: String -> String -> IO (Either Error [Tag])Source

The git tags on a repo, given the repo owner and name.

 tagsFor "thoughtbot" "paperclip"

branchesFor :: String -> String -> IO (Either Error [Branch])Source

The git branches on a repo, given the repo owner and name.

 branchesFor "thoughtbot" "paperclip"

data RepoPublicity Source

Filter the list of the user's repos using any of these constructors.

Constructors

All

All repos accessible to the user.

Owner

Only repos owned by the user.

Public

Only public repos.

Private

Only private repos.

Member

Only repos to which the user is a member but not an owner.

Modifying repositories

Only authenticated users may modify repositories.

data GithubAuth Source

user/password for HTTP basic access authentication

Create

createRepo :: GithubAuth -> NewRepo -> IO (Either Error Repo)Source

Create a new repository.

 createRepo (GithubUser (user, password)) (newRepo "some_repo") {newRepoHasIssues = Just False}

createOrganizationRepo :: GithubAuth -> String -> NewRepo -> IO (Either Error Repo)Source

Create a new repository for an organization.

 createOrganizationRepo (GithubUser (user, password)) "thoughtbot" (newRepo "some_repo") {newRepoHasIssues = Just False}

Edit

editRepoSource

Arguments

:: GithubAuth 
-> String

owner

-> String

repository name

-> Edit 
-> IO (Either Error Repo) 

Edit an existing repository.

 editRepo (GithubUser (user, password)) "some_user" "some_repo" def {editDescription = Just "some description"}

def :: Default a => a

The default value for this type.

Delete

deleteRepoSource

Arguments

:: GithubAuth 
-> String

owner

-> String

repository name

-> IO (Either Error ()) 

Delete an existing repository.

 deleteRepo (GithubUser (user, password)) "thoughtbot" "some_repo"