Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] 7be245b873 Bump globals from 17.7.0 to 17.11.0
Bumps [globals](https://github.com/sindresorhus/globals) from 17.7.0 to 17.11.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.7.0...v17.11.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 17.11.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-31 11:23:32 +00:00
10 changed files with 33 additions and 288 deletions
-12
View File
@@ -110,7 +110,6 @@ Every argument is optional.
| [ignore-pr-updates](#ignore-pr-updates) | Override [ignore-updates](#ignore-updates) for PRs only | | | [ignore-pr-updates](#ignore-pr-updates) | Override [ignore-updates](#ignore-updates) for PRs only | |
| [include-only-assigned](#include-only-assigned) | Process only assigned issues | `false` | | [include-only-assigned](#include-only-assigned) | Process only assigned issues | `false` |
| [sort-by](#sort-by) | What to sort issues and PRs by | `created` | | [sort-by](#sort-by) | What to sort issues and PRs by | `created` |
| [exempt-issue-types](#exempt-issue-types) | Issue types on issues exempted from stale/closed. | |
| [only-issue-types](#only-issue-types) | Only issues with a matching type are processed as stale/closed. | | | [only-issue-types](#only-issue-types) | Only issues with a matching type are processed as stale/closed. | |
### List of output options ### List of output options
@@ -568,17 +567,6 @@ Useful to sort the issues and PRs by the specified field. It accepts `created`,
Default value: `created` Default value: `created`
#### exempt-issue-types
A comma separated list of issue types that can be assigned to issues to exclude them from being marked as stale
(e.g: `Bug,Feature`)
If unset (or an empty string), this option will not alter the stale workflow.
If a type is listed in both `exempt-issue-types` and `only-issue-types`, `exempt-issue-types` takes precedence.
Default value: unset
#### only-issue-types #### only-issue-types
A comma separated list of allowed issue types. Only issues with a matching type will be processed (e.g.: `bug,question`). A comma separated list of allowed issue types. Only issues with a matching type will be processed (e.g.: `bug,question`).
-203
View File
@@ -1,203 +0,0 @@
import {Issue} from '../src/classes/issue';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
describe('exempt-issue-types option', () => {
test('should skip issues with an exempt type', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
exemptIssueTypes: 'question,discussion'
};
const TestIssueList: Issue[] = [
generateIssue(
opts,
1,
'A bug',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
false,
[],
false,
false,
undefined,
[],
'bug'
),
generateIssue(
opts,
2,
'A question',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
false,
[],
false,
false,
undefined,
[],
'question'
),
generateIssue(
opts,
3,
'A discussion',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
false,
[],
false,
false,
undefined,
[],
'discussion'
)
];
const processor = new IssuesProcessorMock(
opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
// The exempt types should not be processed/marked stale
expect(processor.staleIssues.map(i => i.title)).toEqual(['A bug']);
});
test('should process all issues if exemptIssueTypes is unset', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
exemptIssueTypes: ''
};
const TestIssueList: Issue[] = [
generateIssue(
opts,
1,
'A bug',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
false,
[],
false,
false,
undefined,
[],
'bug'
),
generateIssue(
opts,
2,
'A feature',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
false,
[],
false,
false,
undefined,
[],
'feature'
)
];
const processor = new IssuesProcessorMock(
opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
expect(processor.staleIssues.map(i => i.title)).toEqual([
'A bug',
'A feature'
]);
});
test('should take precedence over onlyIssueTypes', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
exemptIssueTypes: 'bug',
onlyIssueTypes: 'bug'
};
const TestIssueList: Issue[] = [
generateIssue(
opts,
1,
'A bug',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
false,
[],
false,
false,
undefined,
[],
'bug'
)
];
const processor = new IssuesProcessorMock(
opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
expect(processor.staleIssues).toEqual([]);
});
test('should ignore exemptIssueTypes filter when item is a pull request', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
exemptIssueTypes: 'bug'
};
const TestIssueList: Issue[] = [
generateIssue(
opts,
1,
'A pull request',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
false,
true,
[],
false,
false,
undefined,
[],
'bug'
)
];
const processor = new IssuesProcessorMock(
opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
expect(processor.staleIssues.map(i => i.title)).toEqual(['A pull request']);
});
});
-4
View File
@@ -208,10 +208,6 @@ inputs:
description: 'Only the issues or the pull requests with an assignee will be marked as stale automatically.' description: 'Only the issues or the pull requests with an assignee will be marked as stale automatically.'
default: 'false' default: 'false'
required: false required: false
exempt-issue-types:
description: 'Issues with a matching type are exempt from being processed as stale/closed. Defaults to `[]` (disabled) and can be a comma-separated list of issue types.'
default: ''
required: false
only-issue-types: only-issue-types:
description: 'Only issues with a matching type are processed as stale/closed. Defaults to `[]` (disabled) and can be a comma-separated list of issue types.' description: 'Only issues with a matching type are processed as stale/closed. Defaults to `[]` (disabled) and can be a comma-separated list of issue types.'
default: '' default: ''
+1 -16
View File
@@ -49743,7 +49743,6 @@ var Option;
Option["IgnorePrUpdates"] = "ignore-pr-updates"; Option["IgnorePrUpdates"] = "ignore-pr-updates";
Option["ExemptDraftPr"] = "exempt-draft-pr"; Option["ExemptDraftPr"] = "exempt-draft-pr";
Option["CloseIssueReason"] = "close-issue-reason"; Option["CloseIssueReason"] = "close-issue-reason";
Option["ExemptIssueTypes"] = "exempt-issue-types";
Option["OnlyIssueTypes"] = "only-issue-types"; Option["OnlyIssueTypes"] = "only-issue-types";
})(Option || (Option = {})); })(Option || (Option = {}));
@@ -51979,19 +51978,6 @@ class IssuesProcessor {
return; 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)); const onlyLabels = wordsToList(this._getOnlyLabels(issue));
if (onlyLabels.length > 0) { 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)})`); 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)})`);
@@ -106918,8 +106904,7 @@ function _getAndValidateArgs() {
exemptDraftPr: getInput('exempt-draft-pr') === 'true', exemptDraftPr: getInput('exempt-draft-pr') === 'true',
closeIssueReason: getInput('close-issue-reason'), closeIssueReason: getInput('close-issue-reason'),
includeOnlyAssigned: getInput('include-only-assigned') === 'true', 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']) { for (const numberInput of ['days-before-stale']) {
if (isNaN(parseFloat(getInput(numberInput)))) { if (isNaN(parseFloat(getInput(numberInput)))) {
+30 -30
View File
@@ -29,7 +29,7 @@
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.15.4", "eslint-plugin-jest": "^29.15.4",
"eslint-plugin-n": "^18.2.1", "eslint-plugin-n": "^18.2.1",
"globals": "^17.7.0", "globals": "^17.11.0",
"jest": "^30.4.2", "jest": "^30.4.2",
"jest-silent-reporter": "^0.6.0", "jest-silent-reporter": "^0.6.0",
"prettier": "^3.9.4", "prettier": "^3.9.4",
@@ -3679,9 +3679,9 @@
} }
}, },
"node_modules/baseline-browser-mapping": { "node_modules/baseline-browser-mapping": {
"version": "2.11.25", "version": "2.10.41",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.25.tgz", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.41.tgz",
"integrity": "sha512-gMmEShwwq7FJqMwvfRwvCl00v4kN+KOfJqXn+f4nrufak5gNHJOksd/60Dvjuz7sI8Y5WiSFBa8FEYr+zoyqCw==", "integrity": "sha512-WwS7MHhqGHHlaVsqRZnhvCEMS0owDX+SxRlve7JkuH7My1Ara3ZriTmCQupPfYjxMZ8I/tgxtJYr2t7taHaH4A==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
@@ -3729,9 +3729,9 @@
} }
}, },
"node_modules/browserslist": { "node_modules/browserslist": {
"version": "4.29.0", "version": "4.28.4",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.0.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz",
"integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==", "integrity": "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -3749,11 +3749,11 @@
], ],
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"baseline-browser-mapping": "^2.11.23", "baseline-browser-mapping": "^2.10.38",
"caniuse-lite": "^1.0.30001810", "caniuse-lite": "^1.0.30001799",
"electron-to-chromium": "^1.5.427", "electron-to-chromium": "^1.5.376",
"node-releases": "^2.0.55", "node-releases": "^2.0.48",
"update-browserslist-db": "^1.3.3" "update-browserslist-db": "^1.2.3"
}, },
"bin": { "bin": {
"browserslist": "cli.js" "browserslist": "cli.js"
@@ -3827,9 +3827,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001810", "version": "1.0.30001800",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001800.tgz",
"integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==", "integrity": "sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -4521,9 +4521,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.433", "version": "1.5.385",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.433.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.385.tgz",
"integrity": "sha512-5lCAbyZBjtmUt/RAGHRqrL2q0oEFRThDAsZHHDn9XHa89Qw7gMYOeSicBTy+AHfvo0r6vwsZvqNJTQIQy1BLzA==", "integrity": "sha512-78sa/M08MNAYHQfjoWMvOlKQqZ0ElhSm/L5HNUc96VZ3b+KvDVnngFm8sYQy0XrhTRgAhggHr5abA7yTvRdo4Q==",
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
@@ -5491,9 +5491,9 @@
} }
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "17.7.0", "version": "17.11.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-17.7.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-17.11.0.tgz",
"integrity": "sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==", "integrity": "sha512-Z2I8hM+PbJDXQDq3Icgpzv+mPdwr68iZUU9d5WW4FuXfDUQfkZaZuvjMv42/5crNyw154+9+VWXbYrUgDXbxNw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -7600,9 +7600,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
"version": "3.15.2", "version": "3.15.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.1.tgz",
"integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", "integrity": "sha512-S99WuO3HlhO3XN41EtYUNl9zzXjoJx7QvmipxsJVxtCBT0YHEFy+iOJhjSvrmV12nYhWpZaM8lPHkJm0yUMbag==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -8222,9 +8222,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/node-releases": { "node_modules/node-releases": {
"version": "2.0.56", "version": "2.0.50",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.56.tgz", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.50.tgz",
"integrity": "sha512-x0InOIyzgdk+eyaWaRJFH5snEtiImgBgblZ2CyPrLmqqcuMQkEvcDPHbzqbD8eDsSeJbVOjn+crzyzHaM4D+/A==", "integrity": "sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -9814,9 +9814,9 @@
} }
}, },
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.3.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
"integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
+1 -1
View File
@@ -58,7 +58,7 @@
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.15.4", "eslint-plugin-jest": "^29.15.4",
"eslint-plugin-n": "^18.2.1", "eslint-plugin-n": "^18.2.1",
"globals": "^17.7.0", "globals": "^17.11.0",
"jest": "^30.4.2", "jest": "^30.4.2",
"jest-silent-reporter": "^0.6.0", "jest-silent-reporter": "^0.6.0",
"prettier": "^3.9.4", "prettier": "^3.9.4",
-18
View File
@@ -268,24 +268,6 @@ 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)); const onlyLabels: string[] = wordsToList(this._getOnlyLabels(issue));
if (onlyLabels.length > 0) { if (onlyLabels.length > 0) {
-1
View File
@@ -50,6 +50,5 @@ export enum Option {
IgnorePrUpdates = 'ignore-pr-updates', IgnorePrUpdates = 'ignore-pr-updates',
ExemptDraftPr = 'exempt-draft-pr', ExemptDraftPr = 'exempt-draft-pr',
CloseIssueReason = 'close-issue-reason', CloseIssueReason = 'close-issue-reason',
ExemptIssueTypes = 'exempt-issue-types',
OnlyIssueTypes = 'only-issue-types' OnlyIssueTypes = 'only-issue-types'
} }
@@ -55,6 +55,5 @@ export interface IIssuesProcessorOptions {
exemptDraftPr: boolean; exemptDraftPr: boolean;
closeIssueReason: string; closeIssueReason: string;
includeOnlyAssigned: boolean; includeOnlyAssigned: boolean;
exemptIssueTypes?: string;
onlyIssueTypes?: string; onlyIssueTypes?: string;
} }
+1 -2
View File
@@ -125,8 +125,7 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
exemptDraftPr: core.getInput('exempt-draft-pr') === 'true', exemptDraftPr: core.getInput('exempt-draft-pr') === 'true',
closeIssueReason: core.getInput('close-issue-reason'), closeIssueReason: core.getInput('close-issue-reason'),
includeOnlyAssigned: core.getInput('include-only-assigned') === 'true', 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']) { for (const numberInput of ['days-before-stale']) {