Skip to content

Commit

Permalink
describe plan steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien HOUZÉ authored Jan 4, 2021
1 parent 954de9f commit d79d64e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ runs:
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
echo "🗺 terraform plan -lock=false -var-file=${{ inputs.terraform-environment }}.tfvars"
plan=$(terraform plan -lock=false -no-color -var-file=${{ inputs.terraform-environment }}.tfvars)
title=$(echo -e "$plan" | grep -e '^Plan:' | sed -E 's|Plan:||')
# remove plan noise
echo "🧹 remove plan noise"
plan=$(
echo -e "$plan" | \
tail -n +$(
Expand All @@ -41,6 +43,7 @@ runs:
)
)
echo "🎁 wrap plan into HTML"
message=$(printf "
<details>
<summary><b>Terraform plan:</b> %s %s</summary>
Expand All @@ -56,6 +59,7 @@ runs:
message="${message//$'\n'/'%0A'}"
message="${message//$'\r'/'%0D'}"
echo "👨‍💻 display plan"
echo -e "$plan"
echo ""
echo ::set-output name=plan-details::"$message"

0 comments on commit d79d64e

Please sign in to comment.