feat(draft-pr): add new option to not process PRs which are in draft (#539)

* chore(assignees): add logs

* feat(draft-pr): add new option to not process PRs which are in draft

* refactor(draft-pr): create a dedicated class to handle the logic

* chore(index): update index file
This commit is contained in:
Geoffrey Testelin
2021-09-20 15:37:32 +02:00
committed by GitHub
parent 303465a5d2
commit 9912fa74d1
13 changed files with 367 additions and 72 deletions

View File

@@ -2,6 +2,7 @@ import {Issue} from '../../src/classes/issue';
import {IssuesProcessor} from '../../src/classes/issues-processor';
import {IComment} from '../../src/interfaces/comment';
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
import {IPullRequest} from '../../src/interfaces/pull-request';
export class IssuesProcessorMock extends IssuesProcessor {
constructor(
@@ -14,7 +15,8 @@ export class IssuesProcessorMock extends IssuesProcessor {
getLabelCreationDate?: (
issue: Issue,
label: string
) => Promise<string | undefined>
) => Promise<string | undefined>,
getPullRequest?: (issue: Issue) => Promise<IPullRequest | undefined | void>
) {
super(options);
@@ -29,5 +31,9 @@ export class IssuesProcessorMock extends IssuesProcessor {
if (getLabelCreationDate) {
this.getLabelCreationDate = getLabelCreationDate;
}
if (getPullRequest) {
this.getPullRequest = getPullRequest;
}
}
}