@@ -238,48 +238,52 @@ void handlePR(string action, PullRequest* _pr)
238238 if (commits is null )
239239 commits = ghGetRequest(pr.commitsURL).readJson[];
240240
241- auto refs = getIssueRefs(commits);
242-
243- auto descs = getDescriptions(refs);
244241 auto comment = pr.getBotComment;
245242
246243 UserMessage[] msgs;
247- if (action == " opened" || action == " synchronize" )
244+ IssueRef[] refs;
245+ Issue[] descs;
246+ if (pr.base.repo.owner.login.among(" dlang" , " dlang-bots" ))
248247 {
249- msgs = pr.checkForWarnings(descs, refs);
250- }
248+ refs = getIssueRefs(commits);
249+ descs = getDescriptions(refs);
250+ if (action == " opened" || action == " synchronize" )
251+ {
252+ msgs = pr.checkForWarnings(descs, refs);
253+ }
251254
252- if (pr.base.repo.owner.login.among(" dlang" , " dlang-bots" ))
253255 pr.updateGithubComment(comment, action, refs, descs, msgs);
254256
255- if (refs.any! (r => r.fixed))
256- {
257- import std.algorithm : canFind, filter, map, sort, uniq;
258- import std.array : array;
259- // references are already sorted by id
260- auto bugzillaIds = refs.map! (r => r.id).uniq;
261- auto bugzillSeverities = descs
262- .filter! (d => bugzillaIds.canFind(d.id))
263- .map! (i => i.severity);
264- logDebug(" [github/handlePR](%s): trying to add bug fix label" , _pr.pid);
265- string [] labels;
266- if (bugzillSeverities.canFind(" enhancement" ))
267- labels ~= " Enhancement" ;
268- else
269- labels ~= " Bug Fix" ;
270-
271- pr.addLabels(labels);
257+ if (refs.any! (r => r.fixed))
258+ {
259+ import std.algorithm : canFind, filter, map, sort, uniq;
260+ import std.array : array;
261+ // references are already sorted by id
262+ auto bugzillaIds = refs.map! (r => r.id).uniq;
263+ auto bugzillSeverities = descs
264+ .filter! (d => bugzillaIds.canFind(d.id))
265+ .map! (i => i.severity);
266+ logDebug(" [github/handlePR](%s): trying to add bug fix label" , _pr.pid);
267+ string [] labels;
268+ if (bugzillSeverities.canFind(" enhancement" ))
269+ labels ~= " Enhancement" ;
270+ else
271+ labels ~= " Bug Fix" ;
272+
273+ pr.addLabels(labels);
274+ }
272275 }
273276
274- if (runTrello)
277+ if (runTrello && pr.base.repo.owner.login == " dlang " )
275278 {
276279 logDebug(" [github/handlePR](%s): updating trello card" , _pr.pid);
277280 updateTrelloCard(action, pr.htmlURL, refs, descs);
278281 }
279282
280283 // When a PR is opened or updated mentioning some Bugzilla issues,
281284 // post a link to the PR as an issue comment.
282- if (runBugzillaUpdates && (action == " opened" || action == " synchronize" ))
285+ if (runBugzillaUpdates && pr.base.repo.owner.login == " dlang" &&
286+ (action == " opened" || action == " synchronize" ))
283287 {
284288 import std.algorithm.iteration : filter, map;
285289 import std.algorithm.searching : canFind;
@@ -324,7 +328,8 @@ void handlePR(string action, PullRequest* _pr)
324328
325329 // When a PR is merged, update Bugzilla issues
326330 // (leave a comment with a link to the PR, and close them appropriately).
327- if (runBugzillaUpdates && action == " merged" )
331+ if (runBugzillaUpdates && pr.base.repo.owner.login == " dlang" &&
332+ action == " merged" )
328333 {
329334 import std.algorithm.iteration : filter, map;
330335 import std.algorithm.searching : canFind, all, startsWith;
0 commit comments