fix: only-issue-types does not affect PRs (#1338)

* fix:  does not affect PRs

* docs: mention new behaviour specifically in README.md

* test: add new test case to avoid regression

* chore: run build
This commit is contained in:
Felix Schneider
2026-06-30 20:46:44 +02:00
committed by GitHub
parent eb5cf3af3a
commit 9461cb1006
4 changed files with 37 additions and 2 deletions

View File

@@ -122,4 +122,37 @@ 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']);
});
});