MCPcopy Create free account
hub / github.com/decaporg/decap-cms / getPullRequests

Method getPullRequests

packages/decap-cms-backend-azure/src/API.ts:598–614  ·  view source on GitHub ↗
(sourceBranch?: string)

Source from the content-addressed store, hash-verified

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

Callers 2

getBranchPullRequestMethod · 0.95

Calls 3

isCMSLabelFunction · 0.90
filterMethod · 0.80
someMethod · 0.80

Tested by

no test coverage detected