mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 17:28:57 +00:00
stale-blocked: Reduce threshold if number blocked PR exceeds 10
This commit is contained in:
@@ -63,6 +63,16 @@ jobs:
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
const blockedCount = prs.filter(pr =>
|
||||
pr.labels.some(l => l.name === labelBlocked)
|
||||
).length;
|
||||
|
||||
let globalThreshold = daysThreshold;
|
||||
|
||||
if (blockedCount > 10) {
|
||||
globalThreshold = Math.floor(daysThreshold / 2);
|
||||
}
|
||||
|
||||
for (const pr of prs) {
|
||||
const prLabels = pr.labels.map(l => l.name);
|
||||
const hasBlocked = prLabels.includes(labelBlocked);
|
||||
@@ -73,8 +83,8 @@ jobs:
|
||||
if (prLabels.includes(exemptLabel)) continue;
|
||||
|
||||
const effectiveThreshold = hasChecks
|
||||
? Math.floor(daysThreshold / 2)
|
||||
: daysThreshold;
|
||||
? Math.floor(globalThreshold / 2)
|
||||
: globalThreshold;
|
||||
|
||||
const commentTemplate = hasBlocked && hasChecks
|
||||
? commentTemplates.both
|
||||
|
||||
Reference in New Issue
Block a user