From ba96dbd18c02c6b3d88edc32f8ffd2b1d95ba587 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 10 Jul 2026 23:13:41 -0700 Subject: [PATCH 1/5] test: cover multiline YAML strings in the input payload Adds a regression test for issue #637 using the multi-line quoted payload shape that a `payload: |` block produces: keys at column 0 and a `text:` value wrapping across a blank line. This fails on js-yaml 5.x (`deficient indentation` -> SlackError) with the production code unchanged, proving the v3.0.4 regression. Co-Authored-By: Claude --- test/content.spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/content.spec.js b/test/content.spec.js index 5288d61b..53ec3d26 100644 --- a/test/content.spec.js +++ b/test/content.spec.js @@ -71,6 +71,21 @@ describe("content", () => { assert.deepEqual(config.content.values, expected); }); + /** + * @see {@link https://github.com/slackapi/slack-github-action/issues/637} + */ + it("parses multiline YAML strings from the input payload", async () => { + mocks.core.getInput + .withArgs("payload") + .returns('channel: C0123456789\ntext: "first line\n\nsecond line"'); + const config = new Config(mocks.core); + const expected = { + channel: "C0123456789", + text: "first line\nsecond line", + }; + assert.deepEqual(config.content.values, expected); + }); + it("parses complete JSON from the input payload", async () => { mocks.core.getInput.withArgs("payload").returns(`{ "message": "this is wrapped", From 505dddfb5ebd130e210abf5f4addba7a22bef0c2 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 10 Jul 2026 23:17:35 -0700 Subject: [PATCH 2/5] fix: revert js-yaml to 4.x to restore multiline payload parsing js-yaml 5.x adopts strict YAML 1.2 flow-scalar indentation and throws `deficient indentation` on a double-quoted value that wraps across a blank line onto a column-0 continuation line. A `payload: |` block strips its common indent, so keys and wrapped values land at column 0 -- the exact shape of a multi-paragraph Slack message. Payloads that worked in v3.0.3 broke in v3.0.4 (#635). 5.x offers no option or schema to relax this (CORE_SCHEMA, YAML11_SCHEMA and the default all throw identically), so revert js-yaml to ^4.2.0 and restore the @types/js-yaml devDependency. This makes the regression test added in the previous commit pass. Fixes #637 Co-Authored-By: Claude --- package-lock.json | 41 +++++++++++++---------------------------- package.json | 3 ++- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85170ee4..1b8d388a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,13 +16,14 @@ "@slack/webhook": "^7.2.0", "flat": "^6.0.1", "https-proxy-agent": "^9.0.0", - "js-yaml": "^5.2.0", + "js-yaml": "^4.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", @@ -462,29 +463,6 @@ "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", @@ -943,6 +921,13 @@ "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", @@ -1701,9 +1686,9 @@ "license": "ISC" }, "node_modules/js-yaml": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.0.tgz", - "integrity": "sha512-YeLUMlvR4Ou1B119LIaM0r65JvbOBooJDc9yEu0dClb/uSC5P4FrLU8OCCz/HXWvtPoIrR0dRzABTjo1sTN9Bw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "funding": [ { "type": "github", @@ -1719,7 +1704,7 @@ "argparse": "^2.0.1" }, "bin": { - "js-yaml": "bin/js-yaml.mjs" + "js-yaml": "bin/js-yaml.js" } }, "node_modules/jsonfile": { diff --git a/package.json b/package.json index 0a3f6015..c1a3153c 100644 --- a/package.json +++ b/package.json @@ -49,13 +49,14 @@ "@slack/webhook": "^7.2.0", "flat": "^6.0.1", "https-proxy-agent": "^9.0.0", - "js-yaml": "^5.2.0", + "js-yaml": "^4.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", From c81612520a4936fd3db92eff654d01d4c7cb7d06 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 10 Jul 2026 23:18:23 -0700 Subject: [PATCH 3/5] test: exercise a multiline payload in the integration workflow The live-API suite only sent single-line `text:` values, so it shared the unit tests' blind spot and would not have caught #637. Add a chat.postMessage step whose `text:` wraps across a blank line onto a column-0 continuation -- the shape a `payload: |` block produces for a multi-paragraph Slack message -- so a future js-yaml bump that breaks this parsing fails against the real API too. Co-Authored-By: Claude --- .github/workflows/integration.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index db008d92..4d3560aa 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -103,6 +103,24 @@ jobs: env: MESSAGE_OUTPUT_TS: ${{ steps.message.outputs.ts }} + - name: "test(api): post a multiline message" + id: multiline + uses: ./ + with: + errors: true + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} + payload: | + channel: ${{ secrets.SLACK_CHANNEL_ID }} + text: ":checkered_flag: A multiline message wraps across lines + + with a blank line before " + + - name: "test(api): confirm the multiline message was posted" + run: test -n "$MULTILINE_OUTPUT_TS" + env: + MULTILINE_OUTPUT_TS: ${{ steps.multiline.outputs.ts }} + - name: "test(api): post a message with blocks" id: blocks uses: ./ From 001d421a46c3eb8dbb4f21b408dcaae98e90499e Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 10 Jul 2026 23:18:48 -0700 Subject: [PATCH 4/5] chore: changeset for the js-yaml 4.x revert Co-Authored-By: Claude --- .changeset/revert-js-yaml-4x.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/revert-js-yaml-4x.md diff --git a/.changeset/revert-js-yaml-4x.md b/.changeset/revert-js-yaml-4x.md new file mode 100644 index 00000000..4d56b1c0 --- /dev/null +++ b/.changeset/revert-js-yaml-4x.md @@ -0,0 +1,5 @@ +--- +"@slack/slack-github-action": patch +--- + +fix: revert multiline yaml parsing indentation change From c40c6bc32323d99498ceb5a1fb387d4e4ef15396 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 10 Jul 2026 23:40:08 -0700 Subject: [PATCH 5/5] test: link issue and trim the multiline test name - Drop "strings" from the unit test name. - Reference issue #637 on the integration workflow step. Co-Authored-By: Claude --- .github/workflows/integration.yml | 2 +- test/content.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4d3560aa..bfb183c1 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -103,7 +103,7 @@ jobs: env: MESSAGE_OUTPUT_TS: ${{ steps.message.outputs.ts }} - - name: "test(api): post a multiline message" + - name: "test(api): post a multiline message" # https://github.com/slackapi/slack-github-action/issues/637 id: multiline uses: ./ with: diff --git a/test/content.spec.js b/test/content.spec.js index 53ec3d26..7704afd0 100644 --- a/test/content.spec.js +++ b/test/content.spec.js @@ -74,7 +74,7 @@ describe("content", () => { /** * @see {@link https://github.com/slackapi/slack-github-action/issues/637} */ - it("parses multiline YAML strings from the input payload", async () => { + it("parses multiline YAML from the input payload", async () => { mocks.core.getInput .withArgs("payload") .returns('channel: C0123456789\ntext: "first line\n\nsecond line"');