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

Method getPullRequests

packages/decap-cms-backend-github/src/API.ts:550–568  ·  view source on GitHub ↗
(
    head: string | undefined,
    state: PullRequestState,
    predicate: (pr: GitHubPull) => boolean,
  )

Source from the content-addressed store, hash-verified

548 }
549
550 async getPullRequests(
551 head: string | undefined,
552 state: PullRequestState,
553 predicate: (pr: GitHubPull) => boolean,
554 ) {
555 const pullRequests: Endpoints['GET /repos/{owner}/{repo}/pulls']['response']['data'] =
556 await this.requestAllPages(`${this.originRepoURL}/pulls`, {
557 params: {
558 ...(head ? { head: await this.getHeadReference(head) } : {}),
559 base: this.branch,
560 state,
561 per_page: 100,
562 },
563 });
564
565 return pullRequests.filter(
566 pr => pr.head.ref.startsWith(`${CMS_BRANCH_PREFIX}/`) && predicate(pr),
567 );
568 }
569
570 async getOpenAuthoringPullRequest(branch: string, pullRequests: GitHubPull[]) {
571 // we can't use labels when using open authoring

Callers 3

getBranchPullRequestMethod · 0.95
migrateToVersion1Method · 0.95

Calls 3

requestAllPagesMethod · 0.95
getHeadReferenceMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected