add: adding all files

This commit is contained in:
Randell Dawson
2018-11-06 23:04:43 -08:00
parent 40f7f9713e
commit 755e44bf4c
16 changed files with 1339 additions and 0 deletions

21
addLabels.js Normal file
View File

@@ -0,0 +1,21 @@
require('dotenv').config();
const { owner, repo } = require('./constants');
const { octokitConfig, octokitAuth } = require('./octokitConfig');
const octokit = require('@octokit/rest')(octokitConfig);
octokit.authenticate(octokitAuth);
const addLabels = (number, labels, log) => {
octokit.issues.addLabels({ owner, repo, number, labels })
.then(() => {
log.update(number, true);
console.log(`PR #${number} added ${JSON.stringify(labels)}\n`);
})
.catch((err) => {
console.log(`PR #${number} had an error when trying to label with ${JSON.stringify(labels)}\n`);
console.log(err)
log.finish()
})
};
exports.addLabels = addLabels;