Skip to content

Commit 1785ca8

Browse files
committed
Add oidc-only flag
1 parent f748a05 commit 1785ca8

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
oidc-audience:
1616
description: "By default, this is the URL of the GitHub repository owner, such as the organization that owns the repository."
1717
required: false
18+
oidc-only:
19+
description: "Set to true to only authenticate using OIDC and not set up JFrog CLI."
20+
default: "false"
21+
required: false
1822
disable-job-summary:
1923
description: "Set to true to disable the generation of Job Summaries."
2024
default: "false"

lib/main.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ function main() {
4040
core.startGroup('Setup JFrog CLI');
4141
utils_1.Utils.setCliEnv();
4242
let jfrogCredentials = yield utils_1.Utils.getJfrogCredentials();
43-
yield utils_1.Utils.getAndAddCliToPath(jfrogCredentials);
44-
yield utils_1.Utils.configJFrogServers(jfrogCredentials);
43+
if (core.getInput(utils_1.Utils.OIDC_ONLY) !== 'true') {
44+
yield utils_1.Utils.getAndAddCliToPath(jfrogCredentials);
45+
yield utils_1.Utils.configJFrogServers(jfrogCredentials);
46+
}
47+
else {
48+
core.debug('Skipping JFrog CLI setup as oidc-only is enabled.');
49+
}
4550
}
4651
catch (error) {
4752
core.setFailed(error.message);

lib/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ Utils.CLI_REMOTE_ARG = 'download-repository';
929929
Utils.OIDC_AUDIENCE_ARG = 'oidc-audience';
930930
// OpenID Connect provider_name input
931931
Utils.OIDC_INTEGRATION_PROVIDER_NAME = 'oidc-provider-name';
932+
// Whether to skip JFrog CLI setup and only use OIDC
933+
Utils.OIDC_ONLY = 'oidc-only';
932934
// Application yaml root key
933935
Utils.APPLICATION_ROOT_YML = 'application';
934936
// Application Config file key, yaml should look like:

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ async function main() {
66
core.startGroup('Setup JFrog CLI');
77
Utils.setCliEnv();
88
let jfrogCredentials: JfrogCredentials = await Utils.getJfrogCredentials();
9-
await Utils.getAndAddCliToPath(jfrogCredentials);
10-
await Utils.configJFrogServers(jfrogCredentials);
9+
if (core.getInput(Utils.OIDC_ONLY) !== 'true') {
10+
await Utils.getAndAddCliToPath(jfrogCredentials);
11+
await Utils.configJFrogServers(jfrogCredentials);
12+
} else {
13+
core.debug('Skipping JFrog CLI setup as oidc-only is enabled.');
14+
}
1115
} catch (error) {
1216
core.setFailed((<any>error).message);
1317
} finally {

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export class Utils {
6060
private static readonly OIDC_AUDIENCE_ARG: string = 'oidc-audience';
6161
// OpenID Connect provider_name input
6262
private static readonly OIDC_INTEGRATION_PROVIDER_NAME: string = 'oidc-provider-name';
63+
// Whether to skip JFrog CLI setup and only use OIDC
64+
public static readonly OIDC_ONLY: string = 'oidc-only';
6365
// Application yaml root key
6466
private static readonly APPLICATION_ROOT_YML: string = 'application';
6567
// Application Config file key, yaml should look like:

0 commit comments

Comments
 (0)