Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support multi-line #377

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions __tests__/fixtures/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ author: 'Niek Palm'
inputs:
inputA:
required: false
description: 'A description'
description: |
A description
This is a multiline description
default: test
inputB:
required: false
description: |
This is a
multiline description
default: test

outputs:
Expand All @@ -13,4 +21,4 @@ outputs:

runs:
using: 'node12'
main: 'dist/index.js'
main: 'dist/index.js'
3 changes: 2 additions & 1 deletion __tests__/fixtures/default.output
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Default test

| parameter | description | required | default |
| --- | --- | --- | --- |
| inputA | A description | `false` | test |
| inputA | A description This is a multiline description | `false` | test |
| inputB | This is a multiline description | `false` | test |


## Outputs
Expand Down
2 changes: 1 addition & 1 deletion src/action-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function createMdTable(
for (const line of tableArray) {
result = `${result}|`;
for (const c of line) {
result = `${result} ${c} |`;
result = `${result} ${c.replace(/(\r\n|\n|\r)/gm, " ")} |`;
}
result = `${result}${getLineBreak(options.lineBreaks)}`;
}
Expand Down