GitHub

GitHub

GitHub class

Constructor

new GitHub(optionsopt)

Create new GitHub object

Source:
Parameters:
Name Type Attributes Description
options Object <optional>

Options for this GitHub instance

Name Type Attributes Description
token String <optional>

Initialize GitHub with auth token

Methods

_exec(key, action, paramsopt) → {Promise.<Object>}

Generic exec method for calling octokit methods

Source:
Parameters:
Name Type Attributes Description
key String

Key for exec call (return object key)

action function

Octokit action to be used

params Object <optional>

Additional params (sent to github)

Returns:
Type:
Promise.<Object>
  • Returns promise with response data

_loadPath(optionsopt)

Load a given path with options

Source:
Parameters:
Name Type Attributes Description
options Object <optional>

Load path options

auth(token)

Authorize this GitHub instance

Source:
Parameters:
Name Type Description
token String

GitHub access token

branch(params)

Get a single branch for a specific repo

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

branch String

Branch name

branches(params)

Get branches for a specific repo

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

collaborators(params)

Get collaborators for a specific repo

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

contributors(params)

Get contributors for a specific repo

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

createFile(params)

Create a file on github

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

path String

Path of file being created

message String

Message for commit on creating file

content String

New content for created file

deleteFile(params)

Update a file on github

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

path String

Path of file being deleted

message String

Message for commit on deleting file

sha String

Current sha of file being deleted

files(paramsopt)

Get file(s) list or conent from github

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Parameters

Name Type Attributes Default Description
path String <optional>
'.'

Path to load (Default is entire repo)

recursive Boolean <optional>

Recursively load files (for dir path only)

flatten Boolean <optional>

Flatten response (for recursive only)

tree Boolean <optional>

Return file tree response (for dir path only)

jekyll(params)

Create a new Jekyll instance for this GitHub connection

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

orgs(paramsopt)

List orgs for authenticated user

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Additional params (sent to github)

repo(params)

Get a specific repo

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

repos(paramsopt)

List repos for authenticated user

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Additional params (sent to github)

updateFile(params)

Update a file on github

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

path String

Path of file being updated

message String

Message for commit on updating file

content String

New content for updated file

sha String

Current sha of file being updated

upsertFiles(params)

Create or update 1 or more files on github

Source:
Parameters:
Name Type Description
params Object

Parameters

Name Type Description
owner String

Repo owner name

repo String

Repo name

files Array

Array of file objects with base64 encoded content

message String

Message for commit on creating file(s)

user(paramsopt)

Get the currently authenticated user

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Additional params (sent to github)