diff --git a/templates/docs-github-action.gotmpl b/templates/docs-github-action.gotmpl
index 8a89fae8..a8fd8111 100644
--- a/templates/docs-github-action.gotmpl
+++ b/templates/docs-github-action.gotmpl
@@ -2,6 +2,7 @@
{{- define "escape_chars" }}{{ . | strings.ReplaceAll "_" "\\_" | strings.ReplaceAll "|" "\\|" | strings.ReplaceAll "*" "\\*" }}{{- end }}
{{- define "sanatize_string" }}{{ . | strings.ReplaceAll "\n\n" "
" | strings.ReplaceAll " \n" "
" | strings.ReplaceAll "\n" "
" | tmpl.Exec "escape_chars" }}{{- end }}
{{- $action := (datasource "action") -}}
+{{ if has $action "inputs" }}
## Inputs
| Name | Description | Default | Required |
@@ -9,7 +10,9 @@
{{- range $key, $input := $action.inputs }}
| {{ tmpl.Exec "escape_chars" $key }} | {{ if (has $input "description") }}{{ tmpl.Exec "sanatize_string" $input.description }}{{ else }}{{ tmpl.Exec "escape_chars" $key }}{{ end }} | {{ if (has $input "default") }}{{ tmpl.Exec "sanatize_string" $input.default }}{{ else }}N/A{{ end }} | {{ if (has $input "required") }}{{ $input.required }}{{ else }}false{{ end }} |
{{- end }}
+{{- end }}
+{{ if has $action "outputs" }}
## Outputs
| Name | Description |
@@ -17,3 +20,4 @@
{{- range $key, $output := $action.outputs }}
| {{ tmpl.Exec "escape_chars" $key }} | {{ if (has $output "description") }}{{ tmpl.Exec "sanatize_string" $output.description }}{{ else }}{{ tmpl.Exec "escape_chars" $key }}{{ end }} |
{{- end }}
+{{- end }}