Skip to content

Commit aaa5752

Browse files
committed
fix: updated workflow apply/approve condition on plan_only
1 parent 3f6b95a commit aaa5752

1 file changed

Lines changed: 18 additions & 23 deletions

File tree

.github/workflows/tf-smurf.yml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ jobs:
125125
runs-on: ubuntu-latest
126126
environment: ${{ inputs.target_environment }}
127127

128-
# outputs:
129-
# tfplanExitCode: ${{ steps.tf-plan.outputs.exitcode }}
128+
outputs:
129+
tfplanExitCode: ${{ steps.tf-plan.outputs.exitcode }}
130130

131131
steps:
132132
- name: 📦 Checkout Repository
@@ -145,17 +145,17 @@ jobs:
145145
_EOT
146146
) >> "$GITHUB_ENV"
147147
148-
# - name: 🟦 Install AWS CLI
149-
# if: ${{ inputs.provider == 'aws' }}
150-
# uses: aws-actions/configure-aws-credentials@v6
151-
# with:
152-
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
153-
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
154-
# aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
155-
# role-to-assume: ${{ secrets.BUILD_ROLE }}
156-
# aws-region: ${{ inputs.aws_region }}
157-
# role-duration-seconds: 900
158-
# role-skip-session-tagging: true
148+
- name: 🟦 Install AWS CLI
149+
if: ${{ inputs.provider == 'aws' }}
150+
uses: aws-actions/configure-aws-credentials@v6
151+
with:
152+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
153+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
154+
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
155+
role-to-assume: ${{ secrets.BUILD_ROLE }}
156+
aws-region: ${{ inputs.aws_region }}
157+
role-duration-seconds: 900
158+
role-skip-session-tagging: true
159159

160160
- name: ☁️ Install Azure CLI
161161
if: ${{ inputs.provider == 'azurerm' }}
@@ -195,18 +195,15 @@ jobs:
195195
196196
- name: 🏗️ Smurf Terraform Init
197197
run: |
198-
#smurf stf init --dir=${{ inputs.terraform_directory }}
199-
echo "This is Init"
198+
smurf stf init --dir=${{ inputs.terraform_directory }}
200199
201200
- name: 🔎 Smurf Terraform validate
202201
run: |
203-
#smurf stf validate --dir=${{ inputs.terraform_directory }}
204-
echo "This is Validate"
202+
smurf stf validate --dir=${{ inputs.terraform_directory }}
205203
206204
- name: 📋 Terraform Plan
207205
run: |
208-
#smurf stf plan --dir=${{ inputs.terraform_directory }}
209-
echo "This is Plan"
206+
smurf stf plan --dir=${{ inputs.terraform_directory }}
210207
211208
- name: ⏳ Approval Before Apply
212209
if: ${{ !inputs.terraform_destroy && !inputs.plan_only }}
@@ -221,8 +218,7 @@ jobs:
221218
- name: 🚀 Terraform Apply
222219
if: ${{ !inputs.terraform_destroy && !inputs.plan_only }}
223220
run: |
224-
#smurf stf apply --auto-approve --dir=${{ inputs.terraform_directory }}
225-
echo "This is Init"
221+
smurf stf apply --auto-approve --dir=${{ inputs.terraform_directory }}
226222
227223
###############################################
228224
# DESTROY → APPROVAL → DESTROY APPLY
@@ -255,6 +251,5 @@ jobs:
255251

256252
- name: 💣 Terraform Destroy
257253
run: |
258-
#smurf stf 'destroy --auto-approve --dir=${{ inputs.terraform_directory }}'
259-
echo "This is Destroy"
254+
smurf stf 'destroy --auto-approve --dir=${{ inputs.terraform_directory }}'
260255
...

0 commit comments

Comments
 (0)