snyk 1.882.0 → 1.885.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.
@@ -1800,7 +1800,7 @@ exports.getSeverityValue = getSeverityValue;
1800
1800
  "use strict";
1801
1801
 
1802
1802
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1803
- exports.mapIacTestResponseToSarifResults = exports.extractReportingDescriptor = exports.createSarifOutputForIac = exports.capitalizePackageManager = exports.getIacDisplayErrorFileOutput = exports.getIacDisplayedOutput = void 0;
1803
+ exports.shareResultsOutput = exports.mapIacTestResponseToSarifResults = exports.extractReportingDescriptor = exports.createSarifOutputForIac = exports.capitalizePackageManager = exports.getIacDisplayErrorFileOutput = exports.getIacDisplayedOutput = void 0;
1804
1804
  const chalk_1 = __webpack_require__(32589);
1805
1805
  const theme_1 = __webpack_require__(86988);
1806
1806
  const Debug = __webpack_require__(15158);
@@ -1816,6 +1816,7 @@ const detect_1 = __webpack_require__(45318);
1816
1816
  const get_severity_value_1 = __webpack_require__(24898);
1817
1817
  const sarif_output_1 = __webpack_require__(5034);
1818
1818
  const version_1 = __webpack_require__(38217);
1819
+ const config_1 = __webpack_require__(22541);
1819
1820
  const debug = Debug('iac-output');
1820
1821
  function formatIacIssue(issue, isNew, path) {
1821
1822
  const newBadge = isNew ? ' (new)' : '';
@@ -2055,6 +2056,15 @@ function getPathRelativeToRepoRoot(repoRoot, basePath, filePath) {
2055
2056
  const fullPath = pathLib.resolve(basePath, filePath).replace(/\\/g, '/');
2056
2057
  return fullPath.replace(repoRoot, '');
2057
2058
  }
2059
+ function shareResultsOutput(iacOutputMeta) {
2060
+ let projectName = iacOutputMeta.projectName;
2061
+ if (iacOutputMeta === null || iacOutputMeta === void 0 ? void 0 : iacOutputMeta.gitRemoteUrl) {
2062
+ // from "http://github.com/snyk/cli.git" to "snyk/cli"
2063
+ projectName = iacOutputMeta.gitRemoteUrl.replace(/^https?:\/\/github.com\/(.*)\.git$/, '$1');
2064
+ }
2065
+ return `Your test results are available at: ${config_1.default.ROOT}/org/${iacOutputMeta.orgName}/projects under the name ${projectName}`;
2066
+ }
2067
+ exports.shareResultsOutput = shareResultsOutput;
2058
2068
 
2059
2069
 
2060
2070
  /***/ }),