(pullRequest: GitHubPull)
| 1421 | } |
| 1422 | |
| 1423 | async forceMergePR(pullRequest: GitHubPull) { |
| 1424 | const result = await this.getDifferences(pullRequest.base.sha, pullRequest.head.sha); |
| 1425 | const files = getTreeFiles(result.files as GitHubCompareFiles); |
| 1426 | |
| 1427 | let commitMessage = 'Automatically generated. Merged on Decap CMS\n\nForce merge of:'; |
| 1428 | files.forEach((file: TreeFileForUpdate) => { |
| 1429 | commitMessage += `\n* "${file.path}"`; |
| 1430 | }); |
| 1431 | console.log( |
| 1432 | '%c Automatic merge not possible - Forcing merge.', |
| 1433 | 'line-height: 30px;text-align: center;font-weight: bold', |
| 1434 | ); |
| 1435 | return this.getDefaultBranch() |
| 1436 | .then(branchData => this.updateTree(branchData.commit.sha, files)) |
| 1437 | .then(changeTree => this.commit(commitMessage, changeTree)) |
| 1438 | .then(response => this.patchBranch(this.branch, response.sha)); |
| 1439 | } |
| 1440 | |
| 1441 | toBase64(str: string) { |
| 1442 | return Promise.resolve(Base64.encode(str)); |
no test coverage detected