| 20 | const changelogPath = join(__dirname, '..', '..', 'changelog.json') |
| 21 | |
| 22 | async function createReleaseBranch(version: string): Promise<void> { |
| 23 | try { |
| 24 | const versionBranch = `releases/${version}` |
| 25 | const currentBranch = ( |
| 26 | await sh('git', 'rev-parse', '--abbrev-ref', 'HEAD') |
| 27 | ).trim() |
| 28 | if (currentBranch !== versionBranch) { |
| 29 | await sh('git', 'checkout', '-b', versionBranch) |
| 30 | } |
| 31 | } catch (error) { |
| 32 | console.log(`Failed to create release branch: ${error}`) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /** Converts a string to Channel type if possible */ |
| 37 | function parseChannel(arg: string): Channel { |