diff --git a/lib/utils.js b/lib/utils.js index 6bb1ea533..a971d5778 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -451,21 +451,17 @@ class Utils { } Utils.setUsageEnvVars(); } - // Set usage variables to be captured by JFrog CLI. + // Set usage variables to be captured by JFrog CLI visibility metric service. static setUsageEnvVars() { - // Repository name, defaulting to an empty string if undefined. - const repoName = process.env.GITHUB_REPOSITORY || ''; - // Workflow name, defaulting to an empty string if undefined. - const jobId = process.env.GITHUB_WORKFLOW || ''; - // Run ID, defaulting to an empty string if undefined. - const runId = process.env.GITHUB_RUN_ID || ''; - // Boolean flag indicating if JF_GIT_TOKEN is set. - const jfGitTokenSet = !!process.env.JF_GIT_TOKEN; - // Export environment variables for JFrog CLI usage. - core.exportVariable('JFROG_CLI_USAGE_JOB_ID', jobId); - core.exportVariable('JFROG_CLI_USAGE_RUN_ID', runId); - core.exportVariable('JFROG_CLI_USAGE_GIT_REPO', repoName); - core.exportVariable('JFROG_CLI_USAGE_GH_TOKEN_FOR_CODE_SCANNING_ALERTS_PROVIDED', jfGitTokenSet); + var _a, _b, _c; + // Set the GitHub repository name or default to an empty string. + core.exportVariable('JFROG_CLI_USAGE_GIT_REPO', (_a = process.env.GITHUB_REPOSITORY) !== null && _a !== void 0 ? _a : ''); + // Set the GitHub workflow name or default to an empty string. + core.exportVariable('JFROG_CLI_USAGE_JOB_ID', (_b = process.env.GITHUB_WORKFLOW) !== null && _b !== void 0 ? _b : ''); + // Set the GitHub run ID or default to an empty string. + core.exportVariable('JFROG_CLI_USAGE_RUN_ID', (_c = process.env.GITHUB_RUN_ID) !== null && _c !== void 0 ? _c : ''); + // Indicate if JF_GIT_TOKEN is provided as an environment variable. + core.exportVariable('JFROG_CLI_USAGE_GH_TOKEN_FOR_CODE_SCANNING_ALERTS_PROVIDED', !!process.env.JF_GIT_TOKEN); } /** * Enabling job summary is done by setting the output dir for the summaries. diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 1326fb5f2..0b34c4962 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.1", + "version": "4.5.3", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index 7d39a5306..4da702222 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.1", + "version": "4.5.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.1", + "version": "4.5.3", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index a945c7443..c8563ae02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.1", + "version": "4.5.3", "private": true, "description": "Setup JFrog CLI in GitHub Actions", "main": "lib/main.js",