fix: add vars for production

This commit is contained in:
Randell Dawson
2018-11-12 12:28:02 -08:00
committed by mrugesh mohapatra
parent 382c096f38
commit 4c59c0565b
3 changed files with 12 additions and 4 deletions

View File

@ -42,7 +42,9 @@ const prPropsToGet = ['number', 'labels', 'user'];
const guideFolderErrorsComment = guideFolderChecks(prFiles, username);
if (guideFolderErrorsComment) {
log.update(number, 'comment', guideFolderErrorsComment);
const result = await addComment(number, guideFolderErrorsComment);
if (process.env.PRODUCTION_RUN) {
const result = await addComment(number, guideFolderErrorsComment);
}
await rateLimiter(process.env.RATELIMIT_INTERVAL | 1500);
labelsToAdd['status: needs update'] = 1;
}
@ -70,7 +72,9 @@ const prPropsToGet = ['number', 'labels', 'user'];
const newLabels = Object.keys(labelsToAdd).filter(label => !existingLabels.includes(label));
if (newLabels.length) {
log.update(number, 'labels', newLabels);
addLabels(number, newLabels, log);
if (process.env.PRODUCTION_RUN) {
addLabels(number, newLabels, log);
}
await rateLimiter(process.env.RATELIMIT_INTERVAL | 1500);
}
else {

View File

@ -1,3 +1,4 @@
const path = require('path');
const fs = require('fs');
const { saveToFile } = require('./fileFunctions');
@ -8,7 +9,8 @@ class PrProcessingLog {
this._lastPRlogged = null;
this._finish = null;
this._prs = {};
this._logfile = 'data/open-prs-processed.json';
//path.resolve(__dirname, '../../../guide');
this._logfile = path.resolve(__dirname, './data/open-prs-processed.json');
}
import() {

View File

@ -1,4 +1,6 @@
USERNAME='camperbot'
ACCESS_TOKEN='replace this with a personal access token'
REPOSITORY_OWNER='freeCodeCamp-rocks'
REPOSITORY='freeCodeCamp'
REPOSITORY='freeCodeCamp'
RATELIMIT_INTERVAL=1500
PRODUCTION_RUN=false