diff --git a/.changeset/bump-js-yaml-5x.md b/.changeset/bump-js-yaml-5x.md new file mode 100644 index 00000000..c035e50d --- /dev/null +++ b/.changeset/bump-js-yaml-5x.md @@ -0,0 +1,17 @@ +--- +"@slack/slack-github-action": major +--- + +build: parse yaml with more strict multiline indentation rules + +Internal dependencies of [`js-yaml@v5`](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md#500---2026-06-20) make YAML parsing more strict and compliant with the YAML specification. Indentation is now required for values that span multiple lines against the base value. + +See the YAML [line prefixes](https://yaml.org/spec/1.2.2/#63-line-prefixes) spec for the expected indentation rule: + +```diff + channel: "C0123" + text: "first line + +- second line" ++ second line" +``` diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bc0188ec..1e5227db 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -114,7 +114,7 @@ jobs: channel: ${{ secrets.SLACK_CHANNEL_ID }} text: ":checkered_flag: A multiline message wraps across lines - with a blank line before " + with a blank line before " - name: "test(api): confirm the multiline message was posted" run: test -n "$MULTILINE_OUTPUT_TS" diff --git a/package-lock.json b/package-lock.json index 66077374..8ade4f8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@slack/web-api": "^8.0.0", "@slack/webhook": "^8.0.0", "flat": "^6.0.1", - "js-yaml": "^4.2.0", + "js-yaml": "^5.2.1", "markup-js": "^1.5.21", "undici": "^8.7.0" }, @@ -481,6 +481,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", @@ -1707,9 +1730,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.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz", + "integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==", "funding": [ { "type": "github", @@ -1725,7 +1748,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 8975a394..99a9b041 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@slack/web-api": "^8.0.0", "@slack/webhook": "^8.0.0", "flat": "^6.0.1", - "js-yaml": "^4.2.0", + "js-yaml": "^5.2.1", "markup-js": "^1.5.21", "undici": "^8.7.0" }, diff --git a/test/content.spec.js b/test/content.spec.js index 7704afd0..072f6a52 100644 --- a/test/content.spec.js +++ b/test/content.spec.js @@ -77,7 +77,7 @@ describe("content", () => { it("parses multiline YAML from the input payload", async () => { mocks.core.getInput .withArgs("payload") - .returns('channel: C0123456789\ntext: "first line\n\nsecond line"'); + .returns('channel: C0123456789\ntext: "first line\n\n second line"'); const config = new Config(mocks.core); const expected = { channel: "C0123456789",