fix: revert multiline yaml parsing indentation change (#638)
https://github.com/slackapi/slack-github-action/issues/637
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@slack/slack-github-action": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: revert multiline yaml parsing indentation change
|
||||||
@@ -103,6 +103,24 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MESSAGE_OUTPUT_TS: ${{ steps.message.outputs.ts }}
|
MESSAGE_OUTPUT_TS: ${{ steps.message.outputs.ts }}
|
||||||
|
|
||||||
|
- name: "test(api): post a multiline message" # https://github.com/slackapi/slack-github-action/issues/637
|
||||||
|
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 <https://github.com/${{ github.repository }}|a link>"
|
||||||
|
|
||||||
|
- 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"
|
- name: "test(api): post a message with blocks"
|
||||||
id: blocks
|
id: blocks
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
Generated
+13
-28
@@ -16,13 +16,14 @@
|
|||||||
"@slack/webhook": "^7.2.0",
|
"@slack/webhook": "^7.2.0",
|
||||||
"flat": "^6.0.1",
|
"flat": "^6.0.1",
|
||||||
"https-proxy-agent": "^9.0.0",
|
"https-proxy-agent": "^9.0.0",
|
||||||
"js-yaml": "^5.2.0",
|
"js-yaml": "^4.2.0",
|
||||||
"markup-js": "^1.5.21"
|
"markup-js": "^1.5.21"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^2.5.1",
|
"@biomejs/biome": "^2.5.1",
|
||||||
"@changesets/cli": "^2.31.0",
|
"@changesets/cli": "^2.31.0",
|
||||||
"@types/flat": "^5.0.5",
|
"@types/flat": "^5.0.5",
|
||||||
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/markup-js": "^1.5.0",
|
"@types/markup-js": "^1.5.0",
|
||||||
"@types/node": "^24.13.2",
|
"@types/node": "^24.13.2",
|
||||||
"@types/sinon": "^21.0.0",
|
"@types/sinon": "^21.0.0",
|
||||||
@@ -462,29 +463,6 @@
|
|||||||
"js-yaml": "^4.1.1"
|
"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": {
|
"node_modules/@changesets/pre": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz",
|
||||||
@@ -943,6 +921,13 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"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": {
|
"node_modules/@types/markup-js": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/markup-js/-/markup-js-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/markup-js/-/markup-js-1.5.0.tgz",
|
||||||
@@ -1701,9 +1686,9 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
"version": "5.2.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
|
||||||
"integrity": "sha512-YeLUMlvR4Ou1B119LIaM0r65JvbOBooJDc9yEu0dClb/uSC5P4FrLU8OCCz/HXWvtPoIrR0dRzABTjo1sTN9Bw==",
|
"integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -1719,7 +1704,7 @@
|
|||||||
"argparse": "^2.0.1"
|
"argparse": "^2.0.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"js-yaml": "bin/js-yaml.mjs"
|
"js-yaml": "bin/js-yaml.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jsonfile": {
|
"node_modules/jsonfile": {
|
||||||
|
|||||||
+2
-1
@@ -49,13 +49,14 @@
|
|||||||
"@slack/webhook": "^7.2.0",
|
"@slack/webhook": "^7.2.0",
|
||||||
"flat": "^6.0.1",
|
"flat": "^6.0.1",
|
||||||
"https-proxy-agent": "^9.0.0",
|
"https-proxy-agent": "^9.0.0",
|
||||||
"js-yaml": "^5.2.0",
|
"js-yaml": "^4.2.0",
|
||||||
"markup-js": "^1.5.21"
|
"markup-js": "^1.5.21"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^2.5.1",
|
"@biomejs/biome": "^2.5.1",
|
||||||
"@changesets/cli": "^2.31.0",
|
"@changesets/cli": "^2.31.0",
|
||||||
"@types/flat": "^5.0.5",
|
"@types/flat": "^5.0.5",
|
||||||
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/markup-js": "^1.5.0",
|
"@types/markup-js": "^1.5.0",
|
||||||
"@types/node": "^24.13.2",
|
"@types/node": "^24.13.2",
|
||||||
"@types/sinon": "^21.0.0",
|
"@types/sinon": "^21.0.0",
|
||||||
|
|||||||
@@ -71,6 +71,21 @@ describe("content", () => {
|
|||||||
assert.deepEqual(config.content.values, expected);
|
assert.deepEqual(config.content.values, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see {@link https://github.com/slackapi/slack-github-action/issues/637}
|
||||||
|
*/
|
||||||
|
it("parses multiline YAML 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 () => {
|
it("parses complete JSON from the input payload", async () => {
|
||||||
mocks.core.getInput.withArgs("payload").returns(`{
|
mocks.core.getInput.withArgs("payload").returns(`{
|
||||||
"message": "this is wrapped",
|
"message": "this is wrapped",
|
||||||
|
|||||||
Reference in New Issue
Block a user