build!: parse yaml with more strict multiline indentation rules (#640)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eden Zimbelman <[email protected]>
This commit is contained in:
co-authored by
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Eden Zimbelman
parent
947ed0677c
commit
b1974f0d29
@@ -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"
|
||||
```
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
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>"
|
||||
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"
|
||||
|
||||
Generated
+28
-5
@@ -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": {
|
||||
|
||||
+1
-1
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user