diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed60f7b..ffbdf42a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [3.4.1](https://github.com/ybiquitous/npm-audit-fix-action/compare/v3.4.0...v3.4.1) (2021-10-16) + +### Bug Fixes + +- remove duplicate lines in commit body ([#507](https://github.com/ybiquitous/npm-audit-fix-action/issues/507)) ([242a4c2](https://github.com/ybiquitous/npm-audit-fix-action/commit/242a4c2c2bccb1f74ce197980f2149269e8a1553)) + +## [3.4.0](https://github.com/ybiquitous/npm-audit-fix-action/compare/v3.3.0...v3.4.0) (2021-10-16) + +### Features + +- **deps:** bump npm from 7 to 8 ([#506](https://github.com/ybiquitous/npm-audit-fix-action/issues/506)) ([5f38573](https://github.com/ybiquitous/npm-audit-fix-action/commit/5f3857374aae4bed1dfea86aa7b1fc6e3a0652f0)) + ## [3.3.0](https://github.com/ybiquitous/npm-audit-fix-action/compare/v3.2.5...v3.3.0) (2021-10-11) ### Features diff --git a/dist/index.cjs b/dist/index.cjs index 65f69031..3ca421e8 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -9277,6 +9277,7 @@ async function auditFix() { * @returns {string} */ function buildCommitBody(report) { + /** @type {string[]} */ const lines = []; lines.push("Summary:"); @@ -9287,11 +9288,15 @@ function buildCommitBody(report) { lines.push(""); if (report.updated.length > 0) { lines.push("Fixed vulnerabilities:"); + + /** @type {Set} */ + const vulnerabilities = new Set(); report.updated.forEach(({ name, severity, title, url }) => { if (severity != null && title != null && url != null) { - lines.push(`- ${name}: "${title}" (${url})`); + vulnerabilities.add(`- ${name}: "${title}" (${url})`); } }); + lines.push(...Array.from(vulnerabilities)); } else { lines.push("No fixed vulnerabilities."); } @@ -9302,7 +9307,7 @@ function buildCommitBody(report) { ;// CONCATENATED MODULE: ./lib/constants.js const PACKAGE_NAME = "ybiquitous/npm-audit-fix-action"; const PACKAGE_URL = "https://github.com/ybiquitous/npm-audit-fix-action"; -const NPM_VERSION = "7"; +const NPM_VERSION = "8"; ;// CONCATENATED MODULE: ./lib/buildPullRequestBody.js diff --git a/lib/buildCommitBody.js b/lib/buildCommitBody.js index b5c60533..1cf6c3be 100644 --- a/lib/buildCommitBody.js +++ b/lib/buildCommitBody.js @@ -3,6 +3,7 @@ * @returns {string} */ export default function buildCommitBody(report) { + /** @type {string[]} */ const lines = []; lines.push("Summary:"); @@ -13,11 +14,15 @@ export default function buildCommitBody(report) { lines.push(""); if (report.updated.length > 0) { lines.push("Fixed vulnerabilities:"); + + /** @type {Set} */ + const vulnerabilities = new Set(); report.updated.forEach(({ name, severity, title, url }) => { if (severity != null && title != null && url != null) { - lines.push(`- ${name}: "${title}" (${url})`); + vulnerabilities.add(`- ${name}: "${title}" (${url})`); } }); + lines.push(...Array.from(vulnerabilities)); } else { lines.push("No fixed vulnerabilities."); } diff --git a/lib/constants.js b/lib/constants.js index 460b3532..81fb6def 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,3 +1,3 @@ export const PACKAGE_NAME = "ybiquitous/npm-audit-fix-action"; export const PACKAGE_URL = "https://github.com/ybiquitous/npm-audit-fix-action"; -export const NPM_VERSION = "7"; +export const NPM_VERSION = "8"; diff --git a/package-lock.json b/package-lock.json index 2b1f31da..d2df4b2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm-audit-fix-action", - "version": "3.3.0", + "version": "3.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "npm-audit-fix-action", - "version": "3.3.0", + "version": "3.4.1", "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", diff --git a/package.json b/package.json index 187e05d3..f34529f5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "npm-audit-fix-action", - "version": "3.3.0", + "version": "3.4.1", "description": "A GitHub Action for `npm audit fix`", "author": "Masafumi Koba", "license": "MIT", @@ -13,7 +13,7 @@ "repository": "ybiquitous/npm-audit-fix-action", "engines": { "node": ">=12.20.0", - "npm": ">=7 <9" + "npm": ">=8" }, "type": "module", "main": "lib/index.js",