@@ -3,13 +3,11 @@ import { getNextBetaVersion, getNextVersion } from './get-next-version';
33import { getCurrentVersion } from './get-current-version' ;
44
55function setFirstVersion ( mainVersion : string , minorVersion : string ) {
6- const nextVersion = `${ mainVersion } .${ minorVersion } .0` ;
7- core . setOutput ( 'version' , nextVersion ) ;
6+ core . setOutput ( 'version' , `${ mainVersion } .${ minorVersion } .0` ) ;
87}
98
109function setFirstBetaVersion ( mainVersion : string , minorVersion : string ) {
11- const nextVersion = `${ mainVersion } .${ minorVersion } .0` ;
12- core . setOutput ( 'version' , `${ nextVersion } -beta.1` ) ;
10+ core . setOutput ( 'version' , `${ mainVersion } .${ minorVersion } .0-beta.1` ) ;
1311}
1412
1513/**
@@ -27,8 +25,7 @@ export async function run(): Promise<void> {
2725 }
2826 const minorVersion = core . getInput ( 'minorVersion' ) ;
2927 const majorVersion = core . getInput ( 'majorVersion' ) ;
30- const publishBeta : boolean =
31- core . getInput ( 'publishBeta' ) . toLowerCase ( ) === 'true' ;
28+ const publishBeta = core . getInput ( 'publishBeta' ) . toLowerCase ( ) === 'true' ;
3229
3330 const currentVersion = await getCurrentVersion ( token ) ;
3431
@@ -55,11 +52,9 @@ export async function run(): Promise<void> {
5552 return ;
5653 }
5754
58- if ( publishBeta ) {
59- core . setOutput ( 'version' , getNextBetaVersion ( currentVersion ) ) ;
60- return ;
61- }
62- core . setOutput ( 'version' , getNextVersion ( currentVersion ) ) ;
55+ publishBeta
56+ ? core . setOutput ( 'version' , getNextBetaVersion ( currentVersion ) )
57+ : core . setOutput ( 'version' , getNextVersion ( currentVersion ) ) ;
6358 } catch ( error ) {
6459 // Fail the workflow run if an error occurs
6560 if ( error instanceof Error ) core . setFailed ( error . message ) ;
0 commit comments