Skip to content

Commit 1127e95

Browse files
authored
added identity flag (#88)
1 parent ff99fd7 commit 1127e95

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

action.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ inputs:
5151
description: "Enable plan storage. Default: 'true'. Set to 'false' to disable plan storage."
5252
required: false
5353
default: 'true'
54+
identity:
55+
description: Atmos auth identity
56+
required: false
57+
default: ""
5458
outputs:
5559
status:
5660
description: Apply Status. Either 'succeeded' or 'failed'
@@ -349,6 +353,13 @@ runs:
349353
350354
TERRAFORM_PLAN_OUTPUT_FILE="./terraform-${GITHUB_RUN_ID}-plan-output.txt"
351355
356+
base_cmd=""
357+
358+
if [[ -n "${{ inputs.identity }}" ]]; then
359+
base_cmd+=" --identity=${{ inputs.identity }}"
360+
fi
361+
362+
352363
tfcmt \
353364
--config "${GITHUB_ACTION_PATH}/config/atmos_plan_summary.yaml" \
354365
-var "target:${{ inputs.stack }}-${{ inputs.component }}" \
@@ -362,6 +373,7 @@ runs:
362373
apply -- \
363374
atmos terraform plan ${{ inputs.component }} \
364375
--stack ${{ inputs.stack }} \
376+
${base_cmd} \
365377
-input=false \
366378
-no-color \
367379
-out=${{ steps.vars.outputs.renewed_plan_file }} \
@@ -383,6 +395,7 @@ runs:
383395
384396
atmos terraform plan-diff ${{ inputs.component }} \
385397
--stack ${{ inputs.stack }} \
398+
${base_cmd} \
386399
-input=false \
387400
-no-color \
388401
--orig ${{ steps.vars.outputs.retrieved_plan_filename }} \
@@ -501,6 +514,7 @@ runs:
501514
apply -- \
502515
atmos terraform deploy ${{ inputs.component }} \
503516
--stack ${{ inputs.stack }} \
517+
${base_cmd} \
504518
-input=false \
505519
-no-color \
506520
--planfile ${{ steps.vars.outputs.renewed_plan_filename }} \
@@ -512,7 +526,10 @@ runs:
512526
set -e
513527
514528
cat "${TERRAFORM_OUTPUT_FILE}"
515-
atmos terraform output ${{ inputs.component }} --stack ${{ inputs.stack }} --skip-init -- -json -compact-warnings -no-color | \
529+
atmos terraform output ${{ inputs.component }} \
530+
--stack ${{ inputs.stack }} \
531+
${base_cmd} \
532+
--skip-init -- -json -compact-warnings -no-color | \
516533
grep -v 'Switched to workspace' | \
517534
awk '$1~/^Warnings:$/ {exit} {print}' | \
518535
grep -v 'WARN detected' 1> ${{ steps.vars.outputs.component_path }}/output_values.json

0 commit comments

Comments
 (0)