Skip to content

Commit aa57b84

Browse files
committed
JPI-396 - add github token param
1 parent 0775fb3 commit aa57b84

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

lib/utils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,13 @@ class Utils {
281281
}
282282
static configJFrogServers(jfrogCredentials) {
283283
return __awaiter(this, void 0, void 0, function* () {
284-
let cliConfigCmd = ['config'];
284+
let cliConfigCmd = [];
285+
let githubToken = jfrogCredentials.githubToken;
286+
if (!!githubToken) {
287+
// Github Token
288+
cliConfigCmd = cliConfigCmd.concat('--github-token', githubToken);
289+
}
290+
cliConfigCmd = cliConfigCmd.concat('config');
285291
for (let configToken of Utils.getConfigTokens()) {
286292
// Mark the credentials as secrets to prevent them from being printed in the logs or exported to other workflows
287293
core.setSecret(configToken);

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface JfrogCredentials {
1313
oidcProviderName?: string;
1414
oidcTokenId?: string;
1515
oidcAudience: string;
16+
githubToken?: string;
1617
}
1718

1819
/**

src/utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,13 @@ export class Utils {
317317
}
318318

319319
public static async configJFrogServers(jfrogCredentials: JfrogCredentials) {
320-
let cliConfigCmd: string[] = ['config'];
320+
let cliConfigCmd: string[] = [];
321+
let githubToken: string | undefined = jfrogCredentials.githubToken;
322+
if (!!githubToken) {
323+
// Github Token
324+
cliConfigCmd = cliConfigCmd.concat('--github-token', githubToken);
325+
}
326+
cliConfigCmd = cliConfigCmd.concat('config');
321327
for (let configToken of Utils.getConfigTokens()) {
322328
// Mark the credentials as secrets to prevent them from being printed in the logs or exported to other workflows
323329
core.setSecret(configToken);

0 commit comments

Comments
 (0)