Skip to content

Commit

Permalink
Merge pull request #284 from tj-actions/chore/escape-default
Browse files Browse the repository at this point in the history
Escaped output default
  • Loading branch information
jackton1 committed Feb 1, 2022
2 parents 02712e9 + 5a15f45 commit 59a5ca4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ Generate documentation from actions.yml like [this](#inputs) by simply adding `I

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

| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|---------------|--------|----------|--------------|---------------------------------------------|
| action | string | false | `action.yml` | Path to the action.yml file<br> |
| col\_max\_width | string | false | `1000` | Max width of a column<br> |
| col\_max\_words | string | false | `5` | Max number of words per<br>line in a column |
| output | string | false | `README.md` | Path to the output file<br> |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|---------------|--------|----------|----------------|---------------------------------------------|
| action | string | false | `"action.yml"` | Path to the action.yml file<br> |
| col\_max\_width | string | false | `"1000"` | Max width of a column<br> |
| col\_max\_words | string | false | `"5"` | Max number of words per<br>line in a column |
| output | string | false | `"README.md"` | Path to the output file<br> |

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

Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ func (a *Action) renderOutput() error {
inputTable.SetColWidth(maxWidth)

for _, key := range keys {
var _default string
var outputDefault string
if len(a.Inputs[key].Default) > 0 {
_default = fmt.Sprintf("`%s`", a.Inputs[key].Default)
outputDefault = fmt.Sprintf("`\"%s\"`", a.Inputs[key].Default)
}
row := []string{key, "string", strconv.FormatBool(a.Inputs[key].Required), _default, wordWrap(a.Inputs[key].Description, maxWords)}
row := []string{key, "string", strconv.FormatBool(a.Inputs[key].Required), outputDefault, wordWrap(a.Inputs[key].Description, maxWords)}
inputTable.Append(row)
}

Expand Down
16 changes: 8 additions & 8 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

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

| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-----------|--------|----------|-----------------------|-------------------------------------------------------------------------------------|
| base_sha | string | false | | Specify a base commit SHA<br>used for comparing changes |
| files | string | false | | Check for changes using only<br>this list of files (Defaults<br>to the entire repo) |
| path | string | false | | Specify a relative path under<br>$GITHUB_WORKSPACE to locate the repository<br> |
| separator | string | true | ` ` | Split character for array output<br> |
| sha | string | true | `${{ github.sha }}` | Specify a current commit SHA<br>used for comparing changes |
| token | string | true | `${{ github.token }}` | Github token or Repo Scoped<br>Personal Access Token |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-----------|--------|----------|-------------------------|-------------------------------------------------------------------------------------|
| base_sha | string | false | | Specify a base commit SHA<br>used for comparing changes |
| files | string | false | | Check for changes using only<br>this list of files (Defaults<br>to the entire repo) |
| path | string | false | | Specify a relative path under<br>$GITHUB_WORKSPACE to locate the repository<br> |
| separator | string | true | `" "` | Split character for array output<br> |
| sha | string | true | `"${{ github.sha }}"` | Specify a current commit SHA<br>used for comparing changes |
| token | string | true | `"${{ github.token }}"` | Github token or Repo Scoped<br>Personal Access Token |

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

Expand Down

0 comments on commit 59a5ca4

Please sign in to comment.