(branchName: string)
| 1251 | } |
| 1252 | |
| 1253 | async backupBranch(branchName: string) { |
| 1254 | try { |
| 1255 | const existingBranch = await this.getBranch(branchName); |
| 1256 | await this.createBranch( |
| 1257 | existingBranch.name.replace( |
| 1258 | new RegExp(`${CMS_BRANCH_PREFIX}/`), |
| 1259 | `${CMS_BRANCH_PREFIX}_${Date.now()}/`, |
| 1260 | ), |
| 1261 | existingBranch.commit.sha, |
| 1262 | ); |
| 1263 | } catch (e) { |
| 1264 | console.warn(e); |
| 1265 | } |
| 1266 | } |
| 1267 | |
| 1268 | async createBranch(branchName: string, sha: string) { |
| 1269 | try { |
no test coverage detected