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 Commands for Enhanced Usage Insights #224

Merged
merged 11 commits into from
Nov 14, 2024
2 changes: 2 additions & 0 deletions lib/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ function collectAndPublishBuildInfoIfNeeded() {
// Publish the build info to Artifactory
try {
core.startGroup('Publish the build info to JFrog Artifactory');
// Used for usage reporting
core.exportVariable("JFROG_CLI_USAGE_BUILD_PUBLISHED_AUTO", "TRUE");
yield utils_1.Utils.runCli(['rt', 'build-publish'], { cwd: workingDirectory });
}
catch (error) {
Expand Down
2 changes: 2 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Utils {
// Use JF_ENV or the credentials found in the environment variables
return jfrogCredentials;
}
// Used for usage reporting
this.exportVariableIfNotSet("JFROG_CLI_USAGE_CONFIG_OIDC", "TRUE");
if (!jfrogCredentials.jfrogUrl) {
throw new Error(`JF_URL must be provided when oidc-provider-name is specified`);
}
Expand Down
2 changes: 2 additions & 0 deletions src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ async function collectAndPublishBuildInfoIfNeeded() {
// Publish the build info to Artifactory
try {
core.startGroup('Publish the build info to JFrog Artifactory');
// Used for usage reporting
core.exportVariable("JFROG_CLI_USAGE_BUILD_PUBLISHED_AUTO", "TRUE");
EyalDelarea marked this conversation as resolved.
Show resolved Hide resolved
await Utils.runCli(['rt', 'build-publish'], { cwd: workingDirectory });
} catch (error) {
core.warning('Failed while attempting to publish the build info to JFrog Artifactory: ' + error);
Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export class Utils {
return jfrogCredentials;
}

// Used for usage reporting
this.exportVariableIfNotSet("JFROG_CLI_USAGE_CONFIG_OIDC","TRUE")
EyalDelarea marked this conversation as resolved.
Show resolved Hide resolved
if (!jfrogCredentials.jfrogUrl) {
throw new Error(`JF_URL must be provided when oidc-provider-name is specified`);
}
Expand Down
Loading