mirror of
https://github.com/actions/stale.git
synced 2025-12-20 06:42:15 +00:00
Release exempt labels
This commit is contained in:
10
lib/main.js
10
lib/main.js
@@ -52,7 +52,11 @@ function processIssues(client, args, operationsLeft, page = 1) {
|
||||
continue;
|
||||
}
|
||||
let staleLabel = isPr ? args.stalePrLabel : args.staleIssueLabel;
|
||||
if (isLabeledStale(issue, staleLabel)) {
|
||||
let exemptLabel = isPr ? args.exemptPrLabel : args.exemptIssueLabel;
|
||||
if (exemptLabel && isLabeled(issue, exemptLabel)) {
|
||||
continue;
|
||||
}
|
||||
else if (isLabeled(issue, staleLabel)) {
|
||||
if (wasLastUpdatedBefore(issue, args.daysBeforeClose)) {
|
||||
operationsLeft -= yield closeIssue(client, issue);
|
||||
}
|
||||
@@ -71,7 +75,7 @@ function processIssues(client, args, operationsLeft, page = 1) {
|
||||
return yield processIssues(client, args, operationsLeft, page + 1);
|
||||
});
|
||||
}
|
||||
function isLabeledStale(issue, label) {
|
||||
function isLabeled(issue, label) {
|
||||
const labelComparer = l => label.localeCompare(l.name, undefined, { sensitivity: 'accent' }) === 0;
|
||||
return issue.labels.filter(labelComparer).length > 0;
|
||||
}
|
||||
@@ -118,7 +122,9 @@ function getAndValidateArgs() {
|
||||
daysBeforeStale: parseInt(core.getInput('days-before-stale', { required: true })),
|
||||
daysBeforeClose: parseInt(core.getInput('days-before-close', { required: true })),
|
||||
staleIssueLabel: core.getInput('stale-issue-label', { required: true }),
|
||||
exemptIssueLabel: core.getInput('exempt-issue-label'),
|
||||
stalePrLabel: core.getInput('stale-pr-label', { required: true }),
|
||||
exemptPrLabel: core.getInput('exempt-pr-label'),
|
||||
operationsPerRun: parseInt(core.getInput('operations-per-run', { required: true }))
|
||||
};
|
||||
for (var numberInput of [
|
||||
|
||||
Reference in New Issue
Block a user