diff --git a/action.yml b/action.yml index 2de3e51ac..1a9a88d9e 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ author: "JFrog" inputs: version: description: "JFrog CLI Version" - default: "2.68.0" + default: "2.71.4" required: false download-repository: description: "Remote repository in Artifactory pointing to 'https://releases.jfrog.io/artifactory/jfrog-cli'. Use this parameter in case you don't have an Internet access." diff --git a/lib/cleanup.js b/lib/cleanup.js index 43f009beb..06492779d 100644 --- a/lib/cleanup.js +++ b/lib/cleanup.js @@ -139,6 +139,9 @@ function collectAndPublishBuildInfoIfNeeded() { // Publish the build info to Artifactory try { core.startGroup('Publish the build info to JFrog Artifactory'); + // Set the environment variable to indicate that the build has been automatically published. + // This is used by the usage report to track instances of automatic build publication. + core.exportVariable('JFROG_CLI_USAGE_AUTO_BUILD_PUBLISHED', 'TRUE'); yield utils_1.Utils.runCli(['rt', 'build-publish'], { cwd: workingDirectory }); } catch (error) { diff --git a/lib/utils.js b/lib/utils.js index 1a05f5af5..0fe8d85e0 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -75,7 +75,10 @@ class Utils { throw new Error(`Getting openID Connect JSON web token failed: ${error.message}`); } try { - return yield this.getJfrogAccessTokenThroughOidcProtocol(jfrogCredentials, jsonWebToken, oidcProviderName); + jfrogCredentials = yield this.getJfrogAccessTokenThroughOidcProtocol(jfrogCredentials, jsonWebToken, oidcProviderName); + // Set environment variable to track OIDC logins in the usage report. + core.exportVariable('JFROG_CLI_USAGE_CONFIG_OIDC', 'TRUE'); + return jfrogCredentials; } catch (error) { throw new Error(`Exchanging JSON web token with an access token failed: ${error.message}`); diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 88491b181..95ad056d4 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.4.1", + "version": "4.4.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index ef41fa397..f91431a8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.4.1", + "version": "4.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jfrog/setup-jfrog-cli", - "version": "4.4.1", + "version": "4.4.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 752772d91..a793a7d1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.4.1", + "version": "4.4.2", "private": true, "description": "Setup JFrog CLI in GitHub Actions", "main": "lib/main.js", diff --git a/src/cleanup.ts b/src/cleanup.ts index 5fcfedbbb..9c1ac8f5a 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -106,6 +106,9 @@ async function collectAndPublishBuildInfoIfNeeded() { // Publish the build info to Artifactory try { core.startGroup('Publish the build info to JFrog Artifactory'); + // Set the environment variable to indicate that the build has been automatically published. + // This is used by the usage report to track instances of automatic build publication. + core.exportVariable('JFROG_CLI_USAGE_AUTO_BUILD_PUBLISHED', 'TRUE'); await Utils.runCli(['rt', 'build-publish'], { cwd: workingDirectory }); } catch (error) { core.warning('Failed while attempting to publish the build info to JFrog Artifactory: ' + error); diff --git a/src/utils.ts b/src/utils.ts index c92ef1524..e4e8a4425 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -96,7 +96,10 @@ export class Utils { } try { - return await this.getJfrogAccessTokenThroughOidcProtocol(jfrogCredentials, jsonWebToken, oidcProviderName); + jfrogCredentials = await this.getJfrogAccessTokenThroughOidcProtocol(jfrogCredentials, jsonWebToken, oidcProviderName); + // Set environment variable to track OIDC logins in the usage report. + core.exportVariable('JFROG_CLI_USAGE_CONFIG_OIDC', 'TRUE'); + return jfrogCredentials; } catch (error: any) { throw new Error(`Exchanging JSON web token with an access token failed: ${error.message}`); }