fix: add vars for production
This commit is contained in:
committed by
mrugesh mohapatra
parent
382c096f38
commit
4c59c0565b
@ -42,7 +42,9 @@ const prPropsToGet = ['number', 'labels', 'user'];
|
|||||||
const guideFolderErrorsComment = guideFolderChecks(prFiles, username);
|
const guideFolderErrorsComment = guideFolderChecks(prFiles, username);
|
||||||
if (guideFolderErrorsComment) {
|
if (guideFolderErrorsComment) {
|
||||||
log.update(number, 'comment', 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);
|
await rateLimiter(process.env.RATELIMIT_INTERVAL | 1500);
|
||||||
labelsToAdd['status: needs update'] = 1;
|
labelsToAdd['status: needs update'] = 1;
|
||||||
}
|
}
|
||||||
@ -70,7 +72,9 @@ const prPropsToGet = ['number', 'labels', 'user'];
|
|||||||
const newLabels = Object.keys(labelsToAdd).filter(label => !existingLabels.includes(label));
|
const newLabels = Object.keys(labelsToAdd).filter(label => !existingLabels.includes(label));
|
||||||
if (newLabels.length) {
|
if (newLabels.length) {
|
||||||
log.update(number, 'labels', newLabels);
|
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);
|
await rateLimiter(process.env.RATELIMIT_INTERVAL | 1500);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { saveToFile } = require('./fileFunctions');
|
const { saveToFile } = require('./fileFunctions');
|
||||||
|
|
||||||
@ -8,7 +9,8 @@ class PrProcessingLog {
|
|||||||
this._lastPRlogged = null;
|
this._lastPRlogged = null;
|
||||||
this._finish = null;
|
this._finish = null;
|
||||||
this._prs = {};
|
this._prs = {};
|
||||||
this._logfile = 'data/open-prs-processed.json';
|
//path.resolve(__dirname, '../../../guide');
|
||||||
|
this._logfile = path.resolve(__dirname, './data/open-prs-processed.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
import() {
|
import() {
|
||||||
|
@ -2,3 +2,5 @@ USERNAME='camperbot'
|
|||||||
ACCESS_TOKEN='replace this with a personal access token'
|
ACCESS_TOKEN='replace this with a personal access token'
|
||||||
REPOSITORY_OWNER='freeCodeCamp-rocks'
|
REPOSITORY_OWNER='freeCodeCamp-rocks'
|
||||||
REPOSITORY='freeCodeCamp'
|
REPOSITORY='freeCodeCamp'
|
||||||
|
RATELIMIT_INTERVAL=1500
|
||||||
|
PRODUCTION_RUN=false
|
||||||
|
Reference in New Issue
Block a user