diff --git a/package-lock.json b/package-lock.json index 414c9325..d42a16d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,14 +17,13 @@ "axios-retry": "^4.5.0", "flat": "^6.0.1", "https-proxy-agent": "^9.0.0", - "js-yaml": "^4.2.0", + "js-yaml": "^5.2.0", "markup-js": "^1.5.21" }, "devDependencies": { "@biomejs/biome": "^2.5.1", "@changesets/cli": "^2.31.0", "@types/flat": "^5.0.5", - "@types/js-yaml": "^4.0.9", "@types/markup-js": "^1.5.0", "@types/node": "^24.13.2", "@types/sinon": "^21.0.0", @@ -464,6 +463,29 @@ "js-yaml": "^4.1.1" } }, + "node_modules/@changesets/parse/node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@changesets/pre": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", @@ -878,13 +900,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/js-yaml": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", - "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/markup-js": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@types/markup-js/-/markup-js-1.5.0.tgz", @@ -1693,9 +1708,9 @@ "license": "ISC" }, "node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.0.tgz", + "integrity": "sha512-YeLUMlvR4Ou1B119LIaM0r65JvbOBooJDc9yEu0dClb/uSC5P4FrLU8OCCz/HXWvtPoIrR0dRzABTjo1sTN9Bw==", "funding": [ { "type": "github", @@ -1711,7 +1726,7 @@ "argparse": "^2.0.1" }, "bin": { - "js-yaml": "bin/js-yaml.js" + "js-yaml": "bin/js-yaml.mjs" } }, "node_modules/jsonfile": { diff --git a/package.json b/package.json index 1faca836..da6dc4db 100644 --- a/package.json +++ b/package.json @@ -50,14 +50,13 @@ "axios-retry": "^4.5.0", "flat": "^6.0.1", "https-proxy-agent": "^9.0.0", - "js-yaml": "^4.2.0", + "js-yaml": "^5.2.0", "markup-js": "^1.5.21" }, "devDependencies": { "@biomejs/biome": "^2.5.1", "@changesets/cli": "^2.31.0", "@types/flat": "^5.0.5", - "@types/js-yaml": "^4.0.9", "@types/markup-js": "^1.5.0", "@types/node": "^24.13.2", "@types/sinon": "^21.0.0", diff --git a/src/content.js b/src/content.js index 07377312..5519d6d2 100644 --- a/src/content.js +++ b/src/content.js @@ -2,7 +2,7 @@ import fs from "node:fs"; import path from "node:path"; import * as github from "@actions/github"; import { flatten } from "flat"; -import yaml from "js-yaml"; +import { JSON_SCHEMA, load } from "js-yaml"; import markup from "markup-js"; import Config from "./config.js"; import SlackError from "./errors.js"; @@ -67,8 +67,8 @@ export default class Content { } try { const content = /** @type {Content} */ ( - yaml.load(config.inputs.payload, { - schema: yaml.JSON_SCHEMA, + load(config.inputs.payload, { + schema: JSON_SCHEMA, }) ); return /** @type {Content} */ (content); @@ -125,10 +125,10 @@ export default class Content { config.inputs.payloadFilePath.endsWith("yaml") || config.inputs.payloadFilePath.endsWith("yml") ) { - const load = yaml.load(input, { - schema: yaml.JSON_SCHEMA, + const content = load(input, { + schema: JSON_SCHEMA, }); - return /** @type {Content} */ (load); + return /** @type {Content} */ (content); } if (config.inputs.payloadFilePath.endsWith("json")) { return JSON.parse(input);