(branchName: string)
| 1277 | } |
| 1278 | |
| 1279 | async backupBranch(branchName: string) { |
| 1280 | try { |
| 1281 | const existingBranch = await this.getBranch(branchName); |
| 1282 | await this.createBranch( |
| 1283 | existingBranch.name.replace( |
| 1284 | new RegExp(`${CMS_BRANCH_PREFIX}/`), |
| 1285 | `${CMS_BRANCH_PREFIX}_${Date.now()}/`, |
| 1286 | ), |
| 1287 | existingBranch.commit.sha, |
| 1288 | ); |
| 1289 | } catch (e) { |
| 1290 | console.warn(e); |
| 1291 | } |
| 1292 | } |
| 1293 | |
| 1294 | async createBranch(branchName: string, sha: string) { |
| 1295 | try { |
no test coverage detected