Skip to content

Commit

Permalink
chore: skip fields that are within the limit (#472)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jackton1 and github-actions[bot] committed May 4, 2023
1 parent 34c0c4c commit 45a609f
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 174 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ Add the `Inputs` and/or `Outputs` and/or `Secrets` (only supported by reusable w

<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->

| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-------------------------|--------|----------|----------------|------------------------------------------------------------------------------------------------|
| bin\_path | string | false | | Path to the auto-doc binary |
| col\_max\_width | string | false | `"1000"` | Max width of a column |
| col\_max\_words | string | false | `"5"` | Max number of words per line<br>in a column |
| filename | string | false | `"action.yml"` | Path to the yaml file |
| input\_columns | string | false | | List of action.yml **input** columns names<br>to display, default (display all columns) |
| output | string | false | `"README.md"` | Path to the output file |
| output\_columns | string | false | | List of action.yml **output** column names<br>to display, default (display all columns) |
| reusable | string | false | | Boolean Indicating whether the file is<br>a reusable workflow |
| reusable\_input\_columns | string | false | | List of reusable workflow **input** column<br>names to display, default (display all columns) |
| reusable\_output\_columns | string | false | | List of reusable workflow **output** column<br>names to display, default (display all columns) |
| reusable\_secret\_columns | string | false | | List of reusable workflow **secret** column<br>names to display, default (display all columns) |
| version | string | false | | The version number to run |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-------------------------|--------|----------|----------------|--------------------------------------------------------------------------------------------------|
| bin\_path | string | false | | Path to the auto-doc binary |
| col\_max\_width | string | false | `"1000"` | Max width of a column |
| col\_max\_words | string | false | `"5"` | Max number of words per line <br>in a column |
| filename | string | false | `"action.yml"` | Path to the yaml file |
| input\_columns | string | false | | List of action.yml **input** columns names <br>to display, default (display all columns) |
| output | string | false | `"README.md"` | Path to the output file |
| output\_columns | string | false | | List of action.yml **output** column names <br>to display, default (display all columns) |
| reusable | string | false | | Boolean Indicating whether the file is <br>a reusable workflow |
| reusable\_input\_columns | string | false | | List of reusable workflow **input** column <br>names to display, default (display all columns) |
| reusable\_output\_columns | string | false | | List of reusable workflow **output** column <br>names to display, default (display all columns) |
| reusable\_secret\_columns | string | false | | List of reusable workflow **secret** column <br>names to display, default (display all columns) |
| version | string | false | | The version number to run |

<!-- AUTO-DOC-INPUT:END -->

Expand Down
4 changes: 2 additions & 2 deletions internal/utils/word_wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

// WordWrap wraps text at the specified number of columns
func WordWrap(s string, limit int) string {
if strings.TrimSpace(s) == "" {
if strings.TrimSpace(s) == "" || len(strings.Fields(s)) <= limit {
return s
}

Expand Down Expand Up @@ -53,7 +53,7 @@ func WordWrap(s string, limit int) string {
limit = len(strSlice)
}

result = result + strings.Join(strSlice[:limit], " ") + "<br>"
result = result + strings.Join(strSlice[:limit], " ") + " <br>"

// discard the elements that were copied over to result
strSlice = strSlice[limit:]
Expand Down

0 comments on commit 45a609f

Please sign in to comment.