Class: RepositoryManager

RepositoryManager

Manages low-level GitHub repository operations


new RepositoryManager(octokit, orgName, repoName)

Parameters:
Name Type Description
octokit Object

Octokit instance

orgName String

GitHub organization name

repoName String

GitHub repository name

Source:

Methods


<async> createOrUpdateFile(path, content, message, branch, sha)

Creates or updates a file in the repository

Parameters:
Name Type Default Description
path String

Path to the file

content String | Object

Content to write (will be encoded)

message String

Commit message

branch String

Branch name

sha String null

SHA of the file (if updating)

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> createRepository(description)

Creates a repository in the organization

Parameters:
Name Type Description
description String

Repository description

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> deleteFile(path, message, branch, sha)

Deletes a file from the repository

Parameters:
Name Type Description
path String

Path to the file

message String

Commit message

branch String

Branch name

sha String

SHA of the file

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> getActionsBilling()

Gets billing information for GitHub Actions

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> getCollaborators()

Gets all users (collaborators) for the repository

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> getContent(path, ref)

Gets content from the repository

Parameters:
Name Type Description
path String

Path to the content

ref String

Branch or commit reference

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> getOrganization()

Gets organization information

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> getStorageBilling()

Gets billing information for GitHub Storage

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>

<async> getUser()

Gets user information

Source:
Returns:

ResponseFactory result

Type
Promise.<Array>