-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Added terraform output to summary #34
Conversation
action.yml
Outdated
@@ -289,7 +289,10 @@ runs: | |||
--output "${{ github.workspace }}/atmos-apply-summary.md" \ | |||
--log-level $([[ "${{ inputs.debug }}" == "true" ]] && echo "DEBUG" || echo "INFO") \ | |||
apply -- terraform apply ${{ steps.vars.outputs.plan_file }} || EXIT_CODE=$? | |||
|
|||
|
|||
TERRAFORM_OUTPUTS=$(terraform output --json | jq -Mr 'to_entries | map(["|", .key, "|", if .value.sensitive then "\\<sensitive\\>" else .value.value end, "|"] | join(" ")) | if length > 0 then ["| name | value |", "|----|----|"] + . else ["No outputs"] end | join("\n")') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TERRAFORM_OUTPUTS=$(terraform output --json | jq -Mr 'to_entries | map(["|", .key, "|", if .value.sensitive then "\\<sensitive\\>" else .value.value end, "|"] | join(" ")) | if length > 0 then ["| name | value |", "|----|----|"] + . else ["No outputs"] end | join("\n")') | |
TERRAFORM_OUTPUTS=$(terraform output --json | jq -Mr 'to_entries | map(["|", .key, "|", if .value.sensitive then "![Sensitive](https://img.shields.io/badge/sensitive-c40000?style=for-the-badge)" else .value.value end, "|"] | join(" ")) | if length > 0 then ["| name | value |", "|:----|:----|"] + . else ["No outputs"] end | join("\n")') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my preference would be to encapsulate single-line outputs with inline code
and multiline values with a
code block
As outputs are often maps, which would render better that way.
Also, I have concerns of the mileage we'll get using JQ for formatting. But if we can get what we need... that's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
what
apply