Skip to content

Commit

Permalink
Fix opentofu init on apply (#54)
Browse files Browse the repository at this point in the history
## what
* Move logs cat exactly after the terraform call
* Use atmos to get output values JSON

## why
* Improve logging info
* Inherit all terraform / tofu  context from atmos

## references
* DEV-2269 Update infra-live and infra-test to use opentofu
  • Loading branch information
goruha authored Jul 18, 2024
1 parent 46010d2 commit 6ef583a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,17 +331,15 @@ runs:
TERRAFORM_RESULT=$?
set -e
${{ steps.command.outputs.value }} output --json > output_values.json
cat "${TERRAFORM_OUTPUT_FILE}"
atmos terraform output ${{ inputs.component }} --stack ${{ inputs.stack }} --skip-init -- -json 1> output_values.json
terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./
sed -i "s#\`<sensitive>\`#![Sensitive](https://img.shields.io/badge/sensitive-c40000?style=for-the-badge)#g" ${{ github.workspace }}/atmos-apply-summary.md
sed -i "s#\`\"#\`#g" ${{ github.workspace }}/atmos-apply-summary.md
sed -i "s#\"\`#\`#g" ${{ github.workspace }}/atmos-apply-summary.md
sed -i "s#|--#|:-#g" ${{ github.workspace }}/atmos-apply-summary.md
cat "${TERRAFORM_OUTPUT_FILE}"
cat "${{ github.workspace }}/atmos-apply-summary.md" >> $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit 6ef583a

Please sign in to comment.