(pullRequest: GitHubPull)
| 1408 | } |
| 1409 | |
| 1410 | async forceMergePR(pullRequest: GitHubPull) { |
| 1411 | const result = await this.getDifferences(pullRequest.base.sha, pullRequest.head.sha); |
| 1412 | const files = getTreeFiles(result.files as GitHubCompareFiles); |
| 1413 | |
| 1414 | let commitMessage = 'Automatically generated. Merged on Decap CMS\n\nForce merge of:'; |
| 1415 | files.forEach((file: TreeFileForUpdate) => { |
| 1416 | commitMessage += `\n* "${file.path}"`; |
| 1417 | }); |
| 1418 | console.log( |
| 1419 | '%c Automatic merge not possible - Forcing merge.', |
| 1420 | 'line-height: 30px;text-align: center;font-weight: bold', |
| 1421 | ); |
| 1422 | return this.getDefaultBranch() |
| 1423 | .then(branchData => this.updateTree(branchData.commit.sha, files)) |
| 1424 | .then(changeTree => this.commit(commitMessage, changeTree)) |
| 1425 | .then(response => this.patchBranch(this.branch, response.sha)); |
| 1426 | } |
| 1427 | |
| 1428 | toBase64(str: string) { |
| 1429 | return Promise.resolve(Base64.encode(str)); |
no test coverage detected