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

Method getBranchPullRequest

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

Source from the content-addressed store, hash-verified

577 }
578
579 async getBranchPullRequest(branch: string) {
580 if (this.useOpenAuthoring) {
581 const pullRequests = await this.getPullRequests(branch, PullRequestState.All, () => true);
582 return this.getOpenAuthoringPullRequest(branch, pullRequests);
583 } else {
584 const pullRequests = await this.getPullRequests(branch, PullRequestState.Open, pr =>
585 withCmsLabel(pr, this.cmsLabelPrefix),
586 );
587 if (pullRequests.length <= 0) {
588 throw new EditorialWorkflowError('content is not under editorial workflow', true);
589 }
590 return pullRequests[0];
591 }
592 }
593
594 async getPullRequestCommits(number: number) {
595 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