Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ inputs:
description: "Enable plan storage. Default: 'true'. Set to 'false' to disable plan storage."
required: false
default: 'true'
identity:
description: Atmos auth identity
required: false
default: ""
outputs:
status:
description: Apply Status. Either 'succeeded' or 'failed'
Expand Down Expand Up @@ -349,6 +353,13 @@ runs:

TERRAFORM_PLAN_OUTPUT_FILE="./terraform-${GITHUB_RUN_ID}-plan-output.txt"

base_cmd=""

if [[ -n "${{ inputs.identity }}" ]]; then
base_cmd+=" --identity=${{ inputs.identity }}"
fi


tfcmt \
--config "${GITHUB_ACTION_PATH}/config/atmos_plan_summary.yaml" \
-var "target:${{ inputs.stack }}-${{ inputs.component }}" \
Expand All @@ -362,6 +373,7 @@ runs:
apply -- \
atmos terraform plan ${{ inputs.component }} \
--stack ${{ inputs.stack }} \
${base_cmd} \
-input=false \
-no-color \
-out=${{ steps.vars.outputs.renewed_plan_file }} \
Expand All @@ -383,6 +395,7 @@ runs:

atmos terraform plan-diff ${{ inputs.component }} \
--stack ${{ inputs.stack }} \
${base_cmd} \
-input=false \
-no-color \
--orig ${{ steps.vars.outputs.retrieved_plan_filename }} \
Expand Down Expand Up @@ -501,6 +514,7 @@ runs:
apply -- \
atmos terraform deploy ${{ inputs.component }} \
--stack ${{ inputs.stack }} \
${base_cmd} \
-input=false \
-no-color \
--planfile ${{ steps.vars.outputs.renewed_plan_filename }} \
Expand All @@ -512,7 +526,10 @@ runs:
set -e

cat "${TERRAFORM_OUTPUT_FILE}"
atmos terraform output ${{ inputs.component }} --stack ${{ inputs.stack }} --skip-init -- -json -compact-warnings -no-color | \
atmos terraform output ${{ inputs.component }} \
--stack ${{ inputs.stack }} \
${base_cmd} \
--skip-init -- -json -compact-warnings -no-color | \
grep -v 'Switched to workspace' | \
awk '$1~/^Warnings:$/ {exit} {print}' | \
grep -v 'WARN detected' 1> ${{ steps.vars.outputs.component_path }}/output_values.json
Expand Down
Loading