Skip to content

Commit 88389c9

Browse files
authored
Export JFROG_CLI_GITHUB_TOKEN env var (jfrog#288)
1 parent 3e38315 commit 88389c9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: "JFrog"
44
inputs:
55
version:
66
description: "JFrog CLI Version"
7-
default: "2.75.0"
7+
default: "2.78.2"
88
required: false
99
download-repository:
1010
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."

lib/utils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,14 @@ class Utils {
245245
return Utils.SETUP_JFROG_CLI_SERVER_ID;
246246
}
247247
static setCliEnv() {
248-
var _a, _b, _c, _d;
248+
var _a, _b, _c, _d, _e;
249249
Utils.exportVariableIfNotSet('JFROG_CLI_ENV_EXCLUDE', '*password*;*secret*;*key*;*token*;*auth*;JF_ARTIFACTORY_*;JF_ENV_*;JF_URL;JF_USER;JF_PASSWORD;JF_ACCESS_TOKEN');
250250
Utils.exportVariableIfNotSet('JFROG_CLI_OFFER_CONFIG', 'false');
251251
Utils.exportVariableIfNotSet('CI', 'true');
252252
Utils.exportVariableIfNotSet('JFROG_CLI_SOURCECODE_REPOSITORY', (_a = process.env.GITHUB_REPOSITORY) !== null && _a !== void 0 ? _a : '');
253253
Utils.exportVariableIfNotSet('JFROG_CLI_CI_JOB_ID', (_b = process.env.GITHUB_WORKFLOW) !== null && _b !== void 0 ? _b : '');
254254
Utils.exportVariableIfNotSet('JFROG_CLI_CI_RUN_ID', (_c = process.env.GITHUB_RUN_ID) !== null && _c !== void 0 ? _c : '');
255+
Utils.exportVariableIfNotSet('JFROG_CLI_GITHUB_TOKEN', (_d = process.env.GITHUB_TOKEN) !== null && _d !== void 0 ? _d : '');
255256
let buildNameEnv = process.env.GITHUB_WORKFLOW;
256257
if (buildNameEnv) {
257258
Utils.exportVariableIfNotSet('JFROG_CLI_BUILD_NAME', buildNameEnv);
@@ -272,7 +273,7 @@ class Utils {
272273
job_summary_1.JobSummary.enableJobSummaries();
273274
}
274275
// Indicate if JF_GIT_TOKEN is provided as an environment variable, used by Xray usage.
275-
Utils.exportVariableIfNotSet('JFROG_CLI_USAGE_GH_TOKEN_FOR_CODE_SCANNING_ALERTS_PROVIDED', (_d = process.env.JF_GIT_TOKEN) !== null && _d !== void 0 ? _d : '');
276+
Utils.exportVariableIfNotSet('JFROG_CLI_USAGE_GH_TOKEN_FOR_CODE_SCANNING_ALERTS_PROVIDED', (_e = process.env.JF_GIT_TOKEN) !== null && _e !== void 0 ? _e : '');
276277
}
277278
static exportVariableIfNotSet(key, value) {
278279
if (!process.env[key]) {

src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export class Utils {
282282
Utils.exportVariableIfNotSet('JFROG_CLI_SOURCECODE_REPOSITORY', process.env.GITHUB_REPOSITORY ?? '');
283283
Utils.exportVariableIfNotSet('JFROG_CLI_CI_JOB_ID', process.env.GITHUB_WORKFLOW ?? '');
284284
Utils.exportVariableIfNotSet('JFROG_CLI_CI_RUN_ID', process.env.GITHUB_RUN_ID ?? '');
285+
Utils.exportVariableIfNotSet('JFROG_CLI_GITHUB_TOKEN', process.env.GITHUB_TOKEN ?? '');
285286

286287
let buildNameEnv: string | undefined = process.env.GITHUB_WORKFLOW;
287288
if (buildNameEnv) {

0 commit comments

Comments
 (0)