optimize pull request

This commit is contained in:
Sergey Dolin
2023-06-15 23:14:14 +02:00
parent 02989dcb65
commit 51c18470e1
4 changed files with 15 additions and 2 deletions

View File

@@ -27,10 +27,13 @@ export class ExemptDraftPullRequest {
)} is enabled`
);
/* This code was used until Jun 15 2022 - it is unclear why they had to call API for getting pull request
const pullRequest: IPullRequest | undefined | void =
await pullRequestCallback();
if (pullRequest?.draft === true) {
*/
if (this._issue?.draft === true) {
this._issueLogger.info(
LoggerService.white('└──'),
`Skip the $$type draft checks`

View File

@@ -13,6 +13,7 @@ export class Issue implements IIssue {
readonly number: number;
created_at: IsoDateString;
updated_at: IsoDateString;
readonly draft: boolean;
readonly labels: ILabel[];
readonly pull_request: object | null | undefined;
readonly state: string | 'closed' | 'open';
@@ -33,6 +34,7 @@ export class Issue implements IIssue {
this.number = issue.number;
this.created_at = issue.created_at;
this.updated_at = issue.updated_at;
this.draft = issue.draft || false;
this.labels = mapLabels(issue.labels);
this.pull_request = issue.pull_request;
this.state = issue.state;