Skip to content

Commit

Permalink
fix(generate.yml): add -reconfigure flag to terraform init comman…
Browse files Browse the repository at this point in the history
…d to ensure proper initialization of the Terraform workspace

feat(generate.yml): add steps to pull and push the current state file to/from the Terraform backend to ensure consistency and synchronization
  • Loading branch information
jandroav committed Jan 4, 2024
1 parent c15579c commit c2d9f64
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ jobs:

- name: Terraform Init
id: init
run: terraform init
run: terraform init -reconfigure

- name: Terraform Pull state
id: pull
run: terraform state pull > current_state.tfstate

- name: Terraform Validate
id: validate
Expand All @@ -70,6 +74,10 @@ jobs:
run: terraform apply -auto-approve -lock=false
continue-on-error: true

- name: Terraform Push state
id: push
run: terraform state push current_state.tfstate

generate-action:
runs-on: ubuntu-latest
needs: [ create-command-list, create-action-repo ]
Expand Down

0 comments on commit c2d9f64

Please sign in to comment.