mirror of
https://github.com/actions/stale.git
synced 2026-11-29 07:53:05 +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:
@@ -268,6 +268,24 @@ export class IssuesProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
// 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: string[] = wordsToList(this._getOnlyLabels(issue));
|
||||
|
||||
if (onlyLabels.length > 0) {
|
||||
|
||||
@@ -50,5 +50,6 @@ export enum Option {
|
||||
IgnorePrUpdates = 'ignore-pr-updates',
|
||||
ExemptDraftPr = 'exempt-draft-pr',
|
||||
CloseIssueReason = 'close-issue-reason',
|
||||
ExemptIssueTypes = 'exempt-issue-types',
|
||||
OnlyIssueTypes = 'only-issue-types'
|
||||
}
|
||||
|
||||
@@ -55,5 +55,6 @@ export interface IIssuesProcessorOptions {
|
||||
exemptDraftPr: boolean;
|
||||
closeIssueReason: string;
|
||||
includeOnlyAssigned: boolean;
|
||||
exemptIssueTypes?: string;
|
||||
onlyIssueTypes?: string;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,8 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
exemptDraftPr: core.getInput('exempt-draft-pr') === 'true',
|
||||
closeIssueReason: core.getInput('close-issue-reason'),
|
||||
includeOnlyAssigned: core.getInput('include-only-assigned') === 'true',
|
||||
onlyIssueTypes: core.getInput('only-issue-types')
|
||||
onlyIssueTypes: core.getInput('only-issue-types'),
|
||||
exemptIssueTypes: core.getInput('exempt-issue-types')
|
||||
};
|
||||
|
||||
for (const numberInput of ['days-before-stale']) {
|
||||
|
||||
Reference in New Issue
Block a user