(pullRequest: GitHubPull)
| 1382 | } |
| 1383 | |
| 1384 | async forceMergePR(pullRequest: GitHubPull) { |
| 1385 | const result = await this.getDifferences(pullRequest.base.sha, pullRequest.head.sha); |
| 1386 | const files = getTreeFiles(result.files as GitHubCompareFiles); |
| 1387 | |
| 1388 | let commitMessage = 'Automatically generated. Merged on Decap CMS\n\nForce merge of:'; |
| 1389 | files.forEach((file: TreeFileForUpdate) => { |
| 1390 | commitMessage += `\n* "${file.path}"`; |
| 1391 | }); |
| 1392 | console.log( |
| 1393 | '%c Automatic merge not possible - Forcing merge.', |
| 1394 | 'line-height: 30px;text-align: center;font-weight: bold', |
| 1395 | ); |
| 1396 | return this.getDefaultBranch() |
| 1397 | .then(branchData => this.updateTree(branchData.commit.sha, files)) |
| 1398 | .then(changeTree => this.commit(commitMessage, changeTree)) |
| 1399 | .then(response => this.patchBranch(this.branch, response.sha)); |
| 1400 | } |
| 1401 | |
| 1402 | toBase64(str: string) { |
| 1403 | return Promise.resolve(Base64.encode(str)); |
no test coverage detected