File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const isValidVersionType = (versionType: string): boolean =>
1919
2020// Returns the latest version of the 1Password CLI based on the specified channel.
2121const getLatestVersion = ( channel : VersionType ) : Promise < string > => {
22+ core . debug ( `Getting ${ channel } version` ) ;
2223 const CLI_URL = "https://app-updates.agilebits.com/product_history/CLI2" ;
2324 return new Promise ( ( resolve , reject ) => {
2425 https
@@ -33,6 +34,7 @@ const getLatestVersion = (channel: VersionType): Promise<string> => {
3334 const versions = matches
3435 . map ( ( match ) => match [ 1 ] ?. trim ( ) )
3536 . filter ( ( ver ) => {
37+ core . debug ( "Found version: " + ver ) ;
3638 if ( channel === VersionType . Latest ) {
3739 return ! ver ?. includes ( "-beta" ) ;
3840 } else if ( channel === VersionType . LatestBeta ) {
@@ -46,7 +48,10 @@ const getLatestVersion = (channel: VersionType): Promise<string> => {
4648 resolve ( `v${ versions [ 0 ] } ` ) ;
4749 } ) ;
4850 } )
49- . on ( "error" , reject ) ;
51+ . on ( "error" , ( e ) => {
52+ core . error ( `Failed to get version of the 1Password CLI: ${ e . message } ` ) ;
53+ reject ( ) ;
54+ } ) ;
5055 } ) ;
5156} ;
5257
You can’t perform that action at this time.
0 commit comments