Automates and simplifies the creation of labels for GitHub repositories
- Install with NPM -
npm install --save git-label
var gitLabel = require('git-label');
var config = {
api : 'https://api.github.com',
repo : 'username/repo',
token : 'yoursupersecretapitoken'
};
var labels = [
{ "name": "bug", "color": "#fc2929" },
{ "name": "duplicate", "color": "#cccccc" }
];
// remove specified labels from a repo
gitLabel.remove(config, labels)
.then(console.log) //=> success message
.catch(console.log) //=> error message
// add specified labels to a repo
gitLabel.add(config, labels)
.then(console.log) //=> success message
.catch(console.log) //=> error message
Name | Type | Argument | Default | Description |
---|---|---|---|---|
config | object |
<required> |
null |
the server configuration object |
config.api | string |
<required> |
null |
the api endpoint to connect to |
config.token | string |
<required> |
null |
the api token to use |
config.repo | string |
<required> |
null |
the git repo to add labels to |
labels | array |
<required> |
null |
the array of label objects |
Name | Type | Argument | Default | Description |
---|---|---|---|---|
config | object |
<required> |
null |
the server configuration object |
config.api | string |
<required> |
null |
the api endpoint to connect to |
config.token | string |
<required> |
null |
the api token to use |
config.repo | string |
<required> |
null |
the git repo to add labels to |
labels | array |
<required> |
null |
the array of label objects |
Name | Type | Argument | Default | Description |
---|---|---|---|---|
pattern | string |
<required> |
null |
the globbing pattern to the label packages |
git-label is built using ES6. Run the following task to compile the src/
into dist/
.
npm run build
- git-label-cli - CLI for this module
- git-label-packages - Default label packages for this module
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
Copyright (c) 2016 Jason Bellamy
Licensed under the MIT license.