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

Method getBranchPullRequest

packages/decap-cms-backend-github/src/API.ts:607–620  ·  view source on GitHub ↗
(branch: string)

Source from the content-addressed store, hash-verified

605 }
606
607 async getBranchPullRequest(branch: string) {
608 if (this.useOpenAuthoring) {
609 const pullRequests = await this.getPullRequests(branch, PullRequestState.All, () => true);
610 return this.getOpenAuthoringPullRequest(branch, pullRequests);
611 } else {
612 const pullRequests = await this.getPullRequests(branch, PullRequestState.Open, pr =>
613 withCmsLabel(pr, this.cmsLabelPrefix),
614 );
615 if (pullRequests.length <= 0) {
616 throw new EditorialWorkflowError('content is not under editorial workflow', true);
617 }
618 return pullRequests[0];
619 }
620 }
621
622 async getPullRequestCommits(number: number) {
623 if (number === MOCK_PULL_REQUEST) {

Callers 9

APIClass · 0.95
getStatusesMethod · 0.95
getStatusesMethod · 0.45

Calls 3

getPullRequestsMethod · 0.95
withCmsLabelFunction · 0.85

Tested by

no test coverage detected