fix: corrected issue with open/close

This commit is contained in:
Randell Dawson
2018-11-09 11:29:22 -08:00
committed by mrugesh mohapatra
parent 4b177e58fc
commit c7aea06a89

View File

@ -2,6 +2,8 @@ require('dotenv').config();
const { owner, repo, fccBaseUrl, prBaseUrl } = require('./constants'); const { owner, repo, fccBaseUrl, prBaseUrl } = require('./constants');
const { octokitConfig, octokitAuth } = require('./octokitConfig'); const { octokitConfig, octokitAuth } = require('./octokitConfig');
const octokit = require('@octokit/rest')(octokitConfig); const octokit = require('@octokit/rest')(octokitConfig);
const { addComment } = require('./addComment');
octokit.authenticate(octokitAuth); octokit.authenticate(octokitAuth);
const prOpenClose = async (number) => { const prOpenClose = async (number) => {
@ -10,13 +12,10 @@ const prOpenClose = async (number) => {
return octokit.pullRequests.update({ owner, repo , number, state: 'open', base: 'master' }) return octokit.pullRequests.update({ owner, repo , number, state: 'open', base: 'master' })
}) })
.then(() => { .then(() => {
console.log('success') addComment(number, 'Closed and Reopened this PR to attempt to resolve a specific Travis build failure.');
//log.update(true)
}) })
.catch((err) => { .catch((err) => {
console.log('catch')
console.log(err) console.log(err)
//log.update(false)
}) })
}; };