Module: GitHubFunctions

github.js

Version:
  • 1.0.0
Author:
License:
  • Apache-2.0
Source:

Example

const gitHubCtl = new GitHubFunctions(accessToken, myOrgName, 'mr-cli-setup')
const createRepoResp = await gitHubCtl.createRepository()

Requires

  • module:octokit

Methods


<inner> createContainers()

Creates the top level Study, Company and Interaction containers for all mediumroast.io assets

Source:
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the responses or error messages.

Type
Array

<inner> createRepository()

Creates a repository, at the organization level, for keeping track of all mediumroast.io assets

Source:
To Do:
  • Make sure the repo is not public
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the created repo or error message.

Type
Array

<async, inner> getActionsBillings()

Gets the complete billing status for actions from the GitHub API

Source:
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the user info or error message.

Type
Array

<async, inner> getAllUsers()

Gets all of the users from the GitHub API

Source:
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the user info or error message.

Type
Array

<inner> getGitHubOrg()

If the GitHub organization exists retrieves the detail about it and returns to the caller

Source:
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the org or error message.

Type
Array

<async, inner> getStorageBillings()

Gets the complete billing status for actions from the GitHub API

Source:
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the user info or error message.

Type
Array

<async, inner> getUser()

Gets the authenticated user from the GitHub API

Source:
To Do:
  • Add a check to see if the user is a member of the organization
  • Add a check to see if the user has admin rights to the organization
Returns:

An array with position 0 being boolean to signify success/failure and position 1 being the user info or error message.

Type
Array