Skip to content

Commit

Permalink
put plan output to file and cat in later step
Browse files Browse the repository at this point in the history
  • Loading branch information
tjololo committed Jan 10, 2025
1 parent 0770561 commit ac24117
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions actions/terraform/plan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ runs:
if: always()
working-directory: ${{ inputs.working_directory }}
run: |
terraform plan -detailed-exitcode -no-color -input=false -out tfplan.out ${{ inputs.tf_args }}
terraform plan -detailed-exitcode -no-color -input=false -out tfplan.out ${{ inputs.tf_args }} >> tfplan.log 2>&1
env:
ARM_CLIENT_ID: ${{ inputs.arm_client_id }}
ARM_SUBSCRIPTION_ID: ${{ inputs.arm_subscription_id }}
Expand Down Expand Up @@ -144,13 +144,7 @@ runs:
- name: truncate terraform plan result
shell: bash
run: |
stdout="${{steps.plan.outputs.stdout}}"
stderr="${{steps.plan.outputs.stderr}}"
plan=$(cat <<${{ env.DELIMITER }}1
${stdout@Q}
${stderr@Q}
${{ env.DELIMITER }}1
)
plan=$(cat ${{ inputs.working_directory }}/tfplan.log)
plan=$(echo "${plan@Q}" | grep -v 'Refreshing state' | tail --bytes 200000)
echo "PLAN<<${{ env.DELIMITER }}2" >> $GITHUB_ENV
echo '[Lines containing Refreshing state removed]' >> $GITHUB_ENV
Expand Down

0 comments on commit ac24117

Please sign in to comment.