(branchName: string)
| 1290 | } |
| 1291 | |
| 1292 | async backupBranch(branchName: string) { |
| 1293 | try { |
| 1294 | const existingBranch = await this.getBranch(branchName); |
| 1295 | await this.createBranch( |
| 1296 | existingBranch.name.replace( |
| 1297 | new RegExp(`${CMS_BRANCH_PREFIX}/`), |
| 1298 | `${CMS_BRANCH_PREFIX}_${Date.now()}/`, |
| 1299 | ), |
| 1300 | existingBranch.commit.sha, |
| 1301 | ); |
| 1302 | } catch (e) { |
| 1303 | console.warn(e); |
| 1304 | } |
| 1305 | } |
| 1306 | |
| 1307 | async createBranch(branchName: string, sha: string) { |
| 1308 | try { |
no test coverage detected