File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -81,13 +81,16 @@ class Utils {
8181 if ( ! isLatestVer && ( 0 , semver_1 . lt ) ( version , this . MIN_CLI_VERSION ) ) {
8282 throw new Error ( 'Requested to download JFrog CLI version ' + version + ' but must be at least ' + this . MIN_CLI_VERSION ) ;
8383 }
84- if ( jfrogCredentials . oidcProviderName && cliRemote != '' ) {
85- throw new Error ( 'OIDC credentials are not supported for CLI remote downloads, please use an access token instead.' ) ;
86- }
8784 if ( ! isLatestVer && this . loadFromCache ( version ) ) {
8885 core . info ( 'Found JFrog CLI in cache. No need to download' ) ;
8986 return ;
9087 }
88+ // To download CLI from a remote repository, we first need to fetch an access token.
89+ // This should fall back to the 'manual' oidc exchange method.
90+ if ( jfrogCredentials . oidcProviderName && cliRemote != '' ) {
91+ core . debug ( "'Fetching OIDC access token to download CLI from remote repository" ) ;
92+ jfrogCredentials . accessToken = yield oidc_utils_1 . OidcUtils . exchangeOidcToken ( jfrogCredentials ) ;
93+ }
9194 // Download JFrog CLI
9295 let downloadDetails = Utils . extractDownloadDetails ( cliRemote , jfrogCredentials ) ;
9396 let url = Utils . getCliUrl ( version , Utils . getJFrogExecutableName ( ) , downloadDetails ) ;
Original file line number Diff line number Diff line change @@ -95,13 +95,16 @@ export class Utils {
9595 if ( ! isLatestVer && lt ( version , this . MIN_CLI_VERSION ) ) {
9696 throw new Error ( 'Requested to download JFrog CLI version ' + version + ' but must be at least ' + this . MIN_CLI_VERSION ) ;
9797 }
98- if ( jfrogCredentials . oidcProviderName && cliRemote != '' ) {
99- throw new Error ( 'OIDC credentials are not supported for CLI remote downloads, please use an access token instead.' ) ;
100- }
10198 if ( ! isLatestVer && this . loadFromCache ( version ) ) {
10299 core . info ( 'Found JFrog CLI in cache. No need to download' ) ;
103100 return ;
104101 }
102+ // To download CLI from a remote repository, we first need to fetch an access token.
103+ // This should fall back to the 'manual' oidc exchange method.
104+ if ( jfrogCredentials . oidcProviderName && cliRemote != '' ) {
105+ core . debug ( "'Fetching OIDC access token to download CLI from remote repository" ) ;
106+ jfrogCredentials . accessToken = await OidcUtils . exchangeOidcToken ( jfrogCredentials ) ;
107+ }
105108 // Download JFrog CLI
106109 let downloadDetails : DownloadDetails = Utils . extractDownloadDetails ( cliRemote , jfrogCredentials ) ;
107110 let url : string = Utils . getCliUrl ( version , Utils . getJFrogExecutableName ( ) , downloadDetails ) ;
You can’t perform that action at this time.
0 commit comments