(sourceBranch?: string)
| 590 | } |
| 591 | |
| 592 | async getPullRequests(sourceBranch?: string) { |
| 593 | const { value: pullRequests } = await this.requestJSON<AzureArray<AzurePullRequest>>({ |
| 594 | url: `${this.endpointUrl}/pullrequests`, |
| 595 | params: { |
| 596 | 'searchCriteria.status': 'active', |
| 597 | 'searchCriteria.targetRefName': this.branchToRef(this.branch), |
| 598 | 'searchCriteria.includeLinks': false, |
| 599 | ...(sourceBranch ? { 'searchCriteria.sourceRefName': this.branchToRef(sourceBranch) } : {}), |
| 600 | }, |
| 601 | }); |
| 602 | |
| 603 | const filtered = pullRequests.filter(pr => { |
| 604 | const labels = pr.labels ?? []; |
| 605 | return labels.some(label => isCMSLabel(label.name, this.cmsLabelPrefix)); |
| 606 | }); |
| 607 | return filtered; |
| 608 | } |
| 609 | |
| 610 | async listUnpublishedBranches(): Promise<string[]> { |
| 611 | const pullRequests = await this.getPullRequests(); |
no test coverage detected