Skip to content

Commit d55159a

Browse files
authored
Merge pull request EFForg#9312 from galeksandrp/new-ruleset
new-ruleset labeller
2 parents 24338b1 + 1470643 commit d55159a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

utils/labeller/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ function github_process_prs(res, pr_cb){
133133
}
134134

135135
var file_fetches = [];
136+
var newRuleset;
136137

137138
// Out of the list of files for this PR, figure out the minimum Alexa ranking for each
138139
_.each(files, function(file){
@@ -154,9 +155,24 @@ function github_process_prs(res, pr_cb){
154155
}
155156
});
156157
});
158+
159+
if (!fs.existsSync('../../' + file.filename)) {
160+
newRuleset = true;
161+
}
157162
}
158163
});
159164

165+
if (newRuleset) {
166+
console.log("Applying label `new-ruleset` to PR: " + pull_request.number);
167+
168+
github.issues.addLabels(_.extend(httpse, {
169+
number: pull_request.number,
170+
body: ['new-ruleset']
171+
}), function(err, res) {
172+
if (err) console.log(err);
173+
});
174+
}
175+
160176
async.parallel(file_fetches, function(err, res){
161177
if(err) pr_cb(err);
162178

0 commit comments

Comments
 (0)