Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oidc-only flag #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading