Github.createRepo()

Create a new GitHub repository in the specified organization.

Usage

Hover over inputs/exits for more info.

var Github = require('machinepack-github');


// Create a new GitHub repository in the specified organization.

Github.createRepo({

repo: 'sails',

owner: 'balderdashy',

username: 'mikermcneil',

password: 'l0lcatzz',

homepage: 'http://node-machine.org/machinepack-foo',

description: 'A utility for working with direwolves.',

private: false,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Failed; can only create repo for an organization or the user whose credentials were used for authentication (i.e. provided as `username`)

userMismatch: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

repo required

The name for the new GitHub repo (i.e. as it appears in the URL on GitHub)

'sails'
owner required

The name of the organization or user under which the new repo should be created (i.e. as it appears in the URL on GitHub)

'balderdashy'
username required

Your GitHub username (to authenticate with)

'mikermcneil'
password required

Your GitHub password (to authenticate with)

'l0lcatzz'
homepage

A homepage URL to include on the new repo

'http://node-machine.org/machinepack-foo'
description

A short description to include on the new repo

'A utility for working with direwolves.'
private

Whether or not the new repo should be private (defaults to false, i.e. open-source)

false

Exits

error

An unexpected error occurred.

userMismatch

Failed; can only create repo for an organization or the user whose credentials were used for authentication (i.e. provided as `username`)

success

OK.