snyk 1.1255.0 → 1.1256.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/exit-codes.d.ts +2 -0
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/sha256sums.txt +8 -8
- package/src/generated/version +1 -1
- package/wrapper_dist/generated/sha256sums.txt +8 -8
- package/wrapper_dist/generated/version +1 -1
package/dist/cli/exit-codes.d.ts
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -38811,6 +38811,8 @@ exports.EXIT_CODES = {
|
|
|
38811
38811
|
VULNS_FOUND: 1,
|
|
38812
38812
|
ERROR: 2,
|
|
38813
38813
|
NO_SUPPORTED_PROJECTS_DETECTED: 3,
|
|
38814
|
+
EX_UNAVAILABLE: 69,
|
|
38815
|
+
EX_NOPERM: 77,
|
|
38814
38816
|
};
|
|
38815
38817
|
|
|
38816
38818
|
|
|
@@ -38918,6 +38920,15 @@ async function handleError(args, error) {
|
|
|
38918
38920
|
}
|
|
38919
38921
|
let command = 'bad-command';
|
|
38920
38922
|
let exitCode = exit_codes_1.EXIT_CODES.ERROR;
|
|
38923
|
+
// If Snyk CLI is running in CI mode (SNYK_CI=1), differentiate authorization
|
|
38924
|
+
if (process.env.SNYK_CI === '1') {
|
|
38925
|
+
if (error.code === 401 || error.code === 403) {
|
|
38926
|
+
exitCode = exit_codes_1.EXIT_CODES.EX_NOPERM;
|
|
38927
|
+
}
|
|
38928
|
+
else if (error.code >= 400 && error.code < 500) {
|
|
38929
|
+
exitCode = exit_codes_1.EXIT_CODES.EX_UNAVAILABLE;
|
|
38930
|
+
}
|
|
38931
|
+
}
|
|
38921
38932
|
const vulnsFound = error.code === 'VULNS';
|
|
38922
38933
|
if (args.command === 'test' && ((_a = args.options) === null || _a === void 0 ? void 0 : _a.unmanaged)) {
|
|
38923
38934
|
exitCode = vulnsFound ? exit_codes_1.EXIT_CODES.VULNS_FOUND : error.code;
|