diff --git a/dist/index.js b/dist/index.js index 3eb71ed9..4d5d5f9b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8503,8 +8503,10 @@ const EMPTY = "-"; module.exports = function buildPullRequestBody(report, npmVersion) { /** * @param {string} name + * @param {string} version */ - const npmPackage = (name) => `[${name}](https://npm.im/${name})`; + const npmPackage = (name, version) => + `[${name}](https://www.npmjs.com/package/${name}/v/${version})`; /** * @param {...string} items @@ -8549,7 +8551,7 @@ module.exports = function buildPullRequestBody(report, npmVersion) { } lines.push( buildTableRow( - npmPackage(name), + npmPackage(name, version), `${versionLabel(previousVersion)} → ${versionLabel(version)}`, repoLink(name), extra @@ -8568,7 +8570,9 @@ module.exports = function buildPullRequestBody(report, npmVersion) { lines.push(""); lines.push(...header); report.added.forEach(({ name, version }) => { - lines.push(buildTableRow(npmPackage(name), versionLabel(version), repoLink(name), EMPTY)); + lines.push( + buildTableRow(npmPackage(name, version), versionLabel(version), repoLink(name), EMPTY) + ); }); lines.push(""); lines.push(""); @@ -8581,7 +8585,9 @@ module.exports = function buildPullRequestBody(report, npmVersion) { lines.push(""); lines.push(...header); report.removed.forEach(({ name, version }) => { - lines.push(buildTableRow(npmPackage(name), versionLabel(version), repoLink(name), EMPTY)); + lines.push( + buildTableRow(npmPackage(name, version), versionLabel(version), repoLink(name), EMPTY) + ); }); lines.push(""); lines.push(""); diff --git a/lib/__tests__/buildPullRequestBody.test.js b/lib/__tests__/buildPullRequestBody.test.js index 070a7f73..5207a472 100644 --- a/lib/__tests__/buildPullRequestBody.test.js +++ b/lib/__tests__/buildPullRequestBody.test.js @@ -11,8 +11,8 @@ This pull request fixes the vulnerable packages via npm [7.7.0](https://github.c | Package | Version | Source | Detail | |:--------|:-------:|:------:|:-------| -| [minimist](https://npm.im/minimist) | \`1.2.1\` → \`1.2.4\` | [github](https://github.com/substack/minimist) | - | -| [mocha](https://npm.im/mocha) | \`1.3.0\` → \`1.4.3\` | [github](https://github.com/mochajs/mocha) | **[Low]** Prototype Pollution ([ref](https://npmjs.com/advisories/1179)) | +| [minimist](https://www.npmjs.com/package/minimist/v/1.2.4) | \`1.2.1\` → \`1.2.4\` | [github](https://github.com/substack/minimist) | - | +| [mocha](https://www.npmjs.com/package/mocha/v/1.4.3) | \`1.3.0\` → \`1.4.3\` | [github](https://github.com/mochajs/mocha) | **[Low]** Prototype Pollution ([ref](https://npmjs.com/advisories/1179)) | @@ -21,7 +21,7 @@ This pull request fixes the vulnerable packages via npm [7.7.0](https://github.c | Package | Version | Source | Detail | |:--------|:-------:|:------:|:-------| -| [xo](https://npm.im/xo) | \`0.1.1\` | - | - | +| [xo](https://www.npmjs.com/package/xo/v/0.38.0) | \`0.38.0\` | - | - | @@ -30,7 +30,7 @@ This pull request fixes the vulnerable packages via npm [7.7.0](https://github.c | Package | Version | Source | Detail | |:--------|:-------:|:------:|:-------| -| [@gitlab/ui](https://npm.im/@gitlab/ui) | \`1.2.3\` | [gitlab](https://gitlab.com/gitlab-org/gitlab-ui) | - | +| [@gitlab/ui](https://www.npmjs.com/package/@gitlab/ui/v/29.2.0) | \`29.2.0\` | [gitlab](https://gitlab.com/gitlab-org/gitlab-ui) | - | diff --git a/lib/__tests__/fixtures/report.json b/lib/__tests__/fixtures/report.json index 212ba838..301fe3c5 100644 --- a/lib/__tests__/fixtures/report.json +++ b/lib/__tests__/fixtures/report.json @@ -1,6 +1,6 @@ { - "added": [{ "name": "xo", "version": "0.1.1" }], - "removed": [{ "name": "@gitlab/ui", "version": "1.2.3" }], + "added": [{ "name": "xo", "version": "0.38.0" }], + "removed": [{ "name": "@gitlab/ui", "version": "29.2.0" }], "updated": [ { "name": "minimist", diff --git a/lib/buildPullRequestBody.js b/lib/buildPullRequestBody.js index d0f2f404..9473db5f 100644 --- a/lib/buildPullRequestBody.js +++ b/lib/buildPullRequestBody.js @@ -10,8 +10,10 @@ const EMPTY = "-"; module.exports = function buildPullRequestBody(report, npmVersion) { /** * @param {string} name + * @param {string} version */ - const npmPackage = (name) => `[${name}](https://npm.im/${name})`; + const npmPackage = (name, version) => + `[${name}](https://www.npmjs.com/package/${name}/v/${version})`; /** * @param {...string} items @@ -56,7 +58,7 @@ module.exports = function buildPullRequestBody(report, npmVersion) { } lines.push( buildTableRow( - npmPackage(name), + npmPackage(name, version), `${versionLabel(previousVersion)} → ${versionLabel(version)}`, repoLink(name), extra @@ -75,7 +77,9 @@ module.exports = function buildPullRequestBody(report, npmVersion) { lines.push(""); lines.push(...header); report.added.forEach(({ name, version }) => { - lines.push(buildTableRow(npmPackage(name), versionLabel(version), repoLink(name), EMPTY)); + lines.push( + buildTableRow(npmPackage(name, version), versionLabel(version), repoLink(name), EMPTY) + ); }); lines.push(""); lines.push(""); @@ -88,7 +92,9 @@ module.exports = function buildPullRequestBody(report, npmVersion) { lines.push(""); lines.push(...header); report.removed.forEach(({ name, version }) => { - lines.push(buildTableRow(npmPackage(name), versionLabel(version), repoLink(name), EMPTY)); + lines.push( + buildTableRow(npmPackage(name, version), versionLabel(version), repoLink(name), EMPTY) + ); }); lines.push(""); lines.push("");