Skip to content

Commit

Permalink
Use proper exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Aug 21, 2023
1 parent d8f1bf3 commit 9d4dffd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions publish-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ openGalleryApi.post = (url, data, additionalHeaders) =>
console.log(`Published ${id} to https://${registryHost}/extension/${id.split(".")[0]}/${id.split(".")[1]}`);
} else {
console.error("The OVSX_PAT environment variable was not provided, which means the extension cannot be published. Provide it or set SKIP_PUBLISH to true to avoid seeing this.");
process.exitCode = -1;
process.exitCode = 1;
}

} catch (error) {
Expand All @@ -229,7 +229,7 @@ openGalleryApi.post = (url, data, additionalHeaders) =>
} else {
console.error(`[FAIL] Could not process extension: ${JSON.stringify({ extension, context }, null, 2)}`);
console.error(error);
process.exitCode = -1;
process.exitCode = 1;
}
}
})();
4 changes: 2 additions & 2 deletions report-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const generateOpenVsxLink = (/** @type {string} */ id) => `[${id}](https://${reg

if ((unstable || stat.failed.length || outdated) && process.env.VALIDATE_PR === 'true') {
// Fail the validating job if there are failing extensions
process.exitCode = -1;
process.exitCode = 1;
}

/**
Expand All @@ -215,7 +215,7 @@ const generateOpenVsxLink = (/** @type {string} */ id) => `[${id}](https://${reg
// This should indicate a big extension breaking
if (existsFailingExtensionAboveThreshold) {
console.error(`There are outdated extensions above the threshold of ${humanNumber(threshold)} installs. See above for the list.`);
process.exitCode = -1;
process.exitCode = 1;
}

if (msPublished) {
Expand Down

0 comments on commit 9d4dffd

Please sign in to comment.