mirror of
https://gitea.com/actions/stale.git
synced 2026-09-15 17:14:23 +00:00
Add exempt-issue-types option for blocklist filter by issue type (#1294)
* Add exempt-issue-types option for blocklist filter by issue type * Add missing input reading for exempt-issue-types * Keep exempt issue types from filtering pull requests * Document exempt issue type precedence
This commit is contained in:
Vendored
+16
-1
@@ -49743,6 +49743,7 @@ var Option;
|
||||
Option["IgnorePrUpdates"] = "ignore-pr-updates";
|
||||
Option["ExemptDraftPr"] = "exempt-draft-pr";
|
||||
Option["CloseIssueReason"] = "close-issue-reason";
|
||||
Option["ExemptIssueTypes"] = "exempt-issue-types";
|
||||
Option["OnlyIssueTypes"] = "only-issue-types";
|
||||
})(Option || (Option = {}));
|
||||
|
||||
@@ -51978,6 +51979,19 @@ class IssuesProcessor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// exemptIssueTypes wins if both it and onlyIssueTypes are specified
|
||||
if (this.options.exemptIssueTypes && !issue.isPullRequest) {
|
||||
const exemptTypes = this.options.exemptIssueTypes
|
||||
.split(',')
|
||||
.map(t => t.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
const issueType = (issue.issue_type || '').toLowerCase();
|
||||
if (exemptTypes.includes(issueType)) {
|
||||
issueLogger.info(`Skipping this $$type because its type ('${issue.issue_type}') is in exemptIssueTypes (${exemptTypes.join(', ')})`);
|
||||
IssuesProcessor._endIssueProcessing(issue);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const onlyLabels = wordsToList(this._getOnlyLabels(issue));
|
||||
if (onlyLabels.length > 0) {
|
||||
issueLogger.info(`The option ${issueLogger.createOptionLink(Option.OnlyLabels)} was specified to only process issues and pull requests with all those labels (${LoggerService.cyan(onlyLabels.length)})`);
|
||||
@@ -106904,7 +106918,8 @@ function _getAndValidateArgs() {
|
||||
exemptDraftPr: getInput('exempt-draft-pr') === 'true',
|
||||
closeIssueReason: getInput('close-issue-reason'),
|
||||
includeOnlyAssigned: getInput('include-only-assigned') === 'true',
|
||||
onlyIssueTypes: getInput('only-issue-types')
|
||||
onlyIssueTypes: getInput('only-issue-types'),
|
||||
exemptIssueTypes: getInput('exempt-issue-types')
|
||||
};
|
||||
for (const numberInput of ['days-before-stale']) {
|
||||
if (isNaN(parseFloat(getInput(numberInput)))) {
|
||||
|
||||
Reference in New Issue
Block a user