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

Method createPullRequest

packages/decap-cms-backend-bitbucket/src/API.ts:565–588  ·  view source on GitHub ↗
(branch: string, commitMessage: string, status: string)

Source from the content-addressed store, hash-verified

563 }
564
565 async createPullRequest(branch: string, commitMessage: string, status: string) {
566 const pullRequest: BitBucketPullRequest = await this.requestJSON({
567 method: 'POST',
568 url: `${this.repoURL}/pullrequests`,
569 headers: { 'Content-Type': APPLICATION_JSON },
570 body: JSON.stringify({
571 title: commitMessage,
572 source: {
573 branch: {
574 name: branch,
575 },
576 },
577 destination: {
578 branch: {
579 name: this.branch,
580 },
581 },
582 description: DEFAULT_PR_BODY,
583 close_source_branch: true,
584 }),
585 });
586 // use comments for status labels
587 await this.addPullRequestComment(pullRequest, statusToLabel(status, this.cmsLabelPrefix));
588 }
589
590 async getDifferences(source: string, destination: string = this.branch) {
591 if (source === destination) {

Callers 1

editorialWorkflowGitMethod · 0.95

Calls 2

addPullRequestCommentMethod · 0.95
statusToLabelFunction · 0.90

Tested by

no test coverage detected