Skip to content

Commit

Permalink
check if output is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
triat committed Mar 22, 2021
1 parent 30f824c commit f14a5d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The action requires the https://github.com/actions/checkout before to download t
* `tfsec_actions_working_dir` - (Optional) Terraform working directory location. Defaults to `'.'`.
* `tfsec_exclude` - (Optional) Provide checks via `,` without space to exclude from run. No default
* `tfsec_version` - (Optional) Specify the version of tfsec to install. Defaults to the latest
* `tfsec_output_format` - (Optional) The output required default, json, csv, checkstyle, junit, sarif (check `tfsec` for an extensive list)
* `tfsec_output_format` - (Optional) The output format: default, json, csv, checkstyle, junit, sarif (check `tfsec` for an extensive list)
* `tfsec_output_file` - (Optional) The name of the output file

## Outputs
Expand Down
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ inputs:
description: 'Specify the version of tfsec to install'
required: false
tfsec_output_format:
description: 'The output required default, json, csv, checkstyle, junit, sarif (check `tfsec` for an extensive list)'
default: 'default'
description: 'The output format: default, json, csv, checkstyle, junit, sarif (check `tfsec` for an extensive list)'
required: false
tfsec_output_file:
description: 'The name of the output file'
Expand Down
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

#Select the output format
TFSEC_FORMAT="-f ${TFSEC_OUTPUT_FORMAT}"
if [ "${TFSEC_OUTPUT_FILE}" != "" ]; then
TFSEC_FORMAT="-f ${TFSEC_OUTPUT_FILE}"
else
TFSEC_FORMAT=""
fi

#select the output file
if [ "${TFSEC_OUTPUT_FILE}" != "" ]; then
Expand Down

0 comments on commit f14a5d4

Please sign in to comment.