Skip to content

Commit

Permalink
Add oidc-only flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Sep 9, 2024
1 parent eefaace commit 0b644b3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
oidc-audience:
description: "By default, this is the URL of the GitHub repository owner, such as the organization that owns the repository."
required: false
oidc-only:
description: "Set to true to only authenticate using OIDC and not set up JFrog CLI."
default: "false"
required: false
disable-job-summary:
description: "Set to true to disable the generation of Job Summaries."
default: "false"
Expand Down
9 changes: 7 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ function main() {
core.startGroup('Setup JFrog CLI');
utils_1.Utils.setCliEnv();
let jfrogCredentials = yield utils_1.Utils.getJfrogCredentials();
yield utils_1.Utils.getAndAddCliToPath(jfrogCredentials);
yield utils_1.Utils.configJFrogServers(jfrogCredentials);
if (core.getInput(utils_1.Utils.OIDC_ONLY) !== 'true') {
yield utils_1.Utils.getAndAddCliToPath(jfrogCredentials);
yield utils_1.Utils.configJFrogServers(jfrogCredentials);
}
else {
core.debug('Skipping JFrog CLI setup as oidc-only is enabled.');
}
}
catch (error) {
core.setFailed(error.message);
Expand Down
2 changes: 2 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,8 @@ Utils.CLI_REMOTE_ARG = 'download-repository';
Utils.OIDC_AUDIENCE_ARG = 'oidc-audience';
// OpenID Connect provider_name input
Utils.OIDC_INTEGRATION_PROVIDER_NAME = 'oidc-provider-name';
// Whether to skip JFrog CLI setup and only use OIDC
Utils.OIDC_ONLY = 'oidc-only';
// Disable Job Summaries feature flag
Utils.JOB_SUMMARY_DISABLE = 'disable-job-summary';
// Disable auto build info publish feature flag
Expand Down
8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ async function main() {
core.startGroup('Setup JFrog CLI');
Utils.setCliEnv();
let jfrogCredentials: JfrogCredentials = await Utils.getJfrogCredentials();
await Utils.getAndAddCliToPath(jfrogCredentials);
await Utils.configJFrogServers(jfrogCredentials);
if (core.getInput(Utils.OIDC_ONLY) !== 'true') {
await Utils.getAndAddCliToPath(jfrogCredentials);
await Utils.configJFrogServers(jfrogCredentials);
} else {
core.debug('Skipping JFrog CLI setup as oidc-only is enabled.');
}
} catch (error) {
core.setFailed((<any>error).message);
} finally {
Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export class Utils {
private static readonly OIDC_AUDIENCE_ARG: string = 'oidc-audience';
// OpenID Connect provider_name input
private static readonly OIDC_INTEGRATION_PROVIDER_NAME: string = 'oidc-provider-name';
// Whether to skip JFrog CLI setup and only use OIDC
public static readonly OIDC_ONLY: string = 'oidc-only';
// Disable Job Summaries feature flag
public static readonly JOB_SUMMARY_DISABLE: string = 'disable-job-summary';
// Disable auto build info publish feature flag
Expand Down

0 comments on commit 0b644b3

Please sign in to comment.