mirror of
https://github.com/actions/stale.git
synced 2026-07-01 05:38:22 +01:00
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d953fb63f4 |
@@ -569,8 +569,6 @@ A comma separated list of allowed issue types. Only issues with a matching type
|
||||
|
||||
If unset (or an empty string), this option will not alter the stale workflow.
|
||||
|
||||
This option does not affect PRs.
|
||||
|
||||
Default value: unset
|
||||
|
||||
### Usage
|
||||
|
||||
@@ -122,37 +122,4 @@ describe('only-issue-types option', () => {
|
||||
'A feature'
|
||||
]);
|
||||
});
|
||||
|
||||
test('should ignore onlyIssueTypes filter when item is a pull request', async () => {
|
||||
const opts: IIssuesProcessorOptions = {
|
||||
...DefaultProcessorOptions,
|
||||
onlyIssueTypes: 'bug'
|
||||
};
|
||||
const TestIssueList: Issue[] = [
|
||||
generateIssue(
|
||||
opts,
|
||||
1,
|
||||
'A pull request',
|
||||
'2020-01-01T17:00:00Z',
|
||||
'2020-01-01T17:00:00Z',
|
||||
false,
|
||||
true, // isPullRequest = true
|
||||
[],
|
||||
false,
|
||||
false,
|
||||
undefined,
|
||||
[],
|
||||
undefined // pull requests do not have an issue_type
|
||||
)
|
||||
];
|
||||
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']);
|
||||
});
|
||||
});
|
||||
|
||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -513,7 +513,7 @@ class IssuesProcessor {
|
||||
IssuesProcessor._endIssueProcessing(issue);
|
||||
return; // If the issue has an 'include-only-assigned' option set, process only issues with nonempty assignees list
|
||||
}
|
||||
if (this.options.onlyIssueTypes && !issue.isPullRequest) {
|
||||
if (this.options.onlyIssueTypes) {
|
||||
const allowedTypes = this.options.onlyIssueTypes
|
||||
.split(',')
|
||||
.map(t => t.trim().toLowerCase())
|
||||
|
||||
18
package-lock.json
generated
18
package-lock.json
generated
@@ -33,7 +33,7 @@
|
||||
"jest": "^29.6.2",
|
||||
"jest-circus": "^29.5.0",
|
||||
"jest-silent-reporter": "^0.5.0",
|
||||
"js-yaml": "^4.1.1",
|
||||
"js-yaml": "^4.2.0",
|
||||
"prettier": "^2.8.7",
|
||||
"standard-version": "^9.3.1",
|
||||
"terminal-link": "^2.1.1",
|
||||
@@ -5387,10 +5387,20 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
|
||||
"integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
"jest": "^29.6.2",
|
||||
"jest-circus": "^29.5.0",
|
||||
"jest-silent-reporter": "^0.5.0",
|
||||
"js-yaml": "^4.1.1",
|
||||
"js-yaml": "^4.2.0",
|
||||
"prettier": "^2.8.7",
|
||||
"standard-version": "^9.3.1",
|
||||
"terminal-link": "^2.1.1",
|
||||
|
||||
@@ -252,7 +252,7 @@ export class IssuesProcessor {
|
||||
return; // If the issue has an 'include-only-assigned' option set, process only issues with nonempty assignees list
|
||||
}
|
||||
|
||||
if (this.options.onlyIssueTypes && !issue.isPullRequest) {
|
||||
if (this.options.onlyIssueTypes) {
|
||||
const allowedTypes = this.options.onlyIssueTypes
|
||||
.split(',')
|
||||
.map(t => t.trim().toLowerCase())
|
||||
|
||||
Reference in New Issue
Block a user