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

Method createPullRequest

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

Source from the content-addressed store, hash-verified

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

Callers 1

editorialWorkflowGitMethod · 0.95

Calls 2

addPullRequestCommentMethod · 0.95
statusToLabelFunction · 0.90

Tested by

no test coverage detected