Skip to content

Commit

Permalink
Update to version 4.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 committed Sep 3, 2024
1 parent cf48d6a commit bc223d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ function cleanup() {
function buildInfoPostTasks() {
return __awaiter(this, void 0, void 0, function* () {
try {
core.startGroup('Checking connection to Artifactory');
const pingResult = yield utils_1.Utils.runCliAndGetOutput(['rt', 'ping']);
if (pingResult !== 'OK') {
core.warning('Could not connect to Artifactory. Skipping Build Info commands.');
}
} catch (error) {
core.warning(`An error occurred while trying to connect to Artifactory: ${error}`);
core.warning('Skipping Build Info commands.');
core.warning(`An error occurred while trying to connect to Artifactory: ${error}. Skipping Build Info commands.`);
return;
} finally {
core.endGroup();
}
// Auto-publish build info if needed
try {
Expand Down Expand Up @@ -103,6 +105,7 @@ function hasUnpublishedModules(workingDirectory) {
// Save the old value of the environment variable to revert it later
const origValue = process.env[utils_1.Utils.JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR_ENV];
try {
core.startGroup('Check for unpublished modules');
// Avoid saving a command summary for this dry-run command
core.exportVariable(utils_1.Utils.JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR_ENV, '');
// Running build-publish command with a dry-run flag to check if there are any unpublished modules, 'silent' to avoid polluting the logs
Expand All @@ -117,6 +120,7 @@ function hasUnpublishedModules(workingDirectory) {
}
finally {
core.exportVariable(utils_1.Utils.JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR_ENV, origValue);
core.endGroup();
}
});
}
Expand Down
5 changes: 3 additions & 2 deletions src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function cleanup() {
async function buildInfoPostTasks() {
try {
core.startGroup('Checking connection to Artifactory');
const pingResult = await Utils.runCliAndGetOutput(['rt', 'ping']);
const pingResult: string = await Utils.runCliAndGetOutput(['rt', 'ping']);
if (pingResult !== 'OK') {
core.warning('Could not connect to Artifactory. Skipping Build Info commands.');
}
Expand Down Expand Up @@ -54,7 +54,6 @@ async function buildInfoPostTasks() {
} catch (error) {
core.warning('failed while attempting to generate job summary: ' + error);
}

}

function addCachedJfToPath(): boolean {
Expand All @@ -76,6 +75,7 @@ async function hasUnpublishedModules(workingDirectory: string): Promise<boolean>
// Save the old value of the environment variable to revert it later
const origValue: string | undefined = process.env[Utils.JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR_ENV];
try {
core.startGroup('Check for unpublished modules');
// Avoid saving a command summary for this dry-run command
core.exportVariable(Utils.JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR_ENV, '');

Expand All @@ -90,6 +90,7 @@ async function hasUnpublishedModules(workingDirectory: string): Promise<boolean>
throw new Error('Failed to check if there are any unpublished modules: ' + error);
} finally {
core.exportVariable(Utils.JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR_ENV, origValue);
core.endGroup();
}
}

Expand Down

0 comments on commit bc223d9

Please sign in to comment.