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

Method getPullRequests

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

Source from the content-addressed store, hash-verified

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();

Callers 2

getBranchPullRequestMethod · 0.95

Calls 3

isCMSLabelFunction · 0.90
filterMethod · 0.80
someMethod · 0.80

Tested by

no test coverage detected