Skip to content

Commit

Permalink
fix(generate.yml): change output file name from current_state.tfstate…
Browse files Browse the repository at this point in the history
… to current.tfstate in the Terraform Pull state step

fix(generate.yml): add terraform init -force-copy -backend=false command in the Terraform Pull state step to ensure a clean initialization
fix(generate.yml): add terraform init -reconfigure command in the Terraform Push state step to reconfigure the backend before pushing the state
fix(generate.yml): change output file name from current_state.tfstate to current.tfstate in the Terraform Push state step
  • Loading branch information
jandroav committed Jan 4, 2024
1 parent 0ad35d4 commit 8b0021a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ jobs:

- name: Terraform Pull state
id: pull
run: terraform state pull > current_state.tfstate
run: |
terraform state pull > current.tfstate
terraform init -force-copy -backend=false
- name: Terraform Validate
id: validate
Expand All @@ -76,7 +78,9 @@ jobs:

- name: Terraform Push state
id: push
run: terraform state push -lock=false current_state.tfstate
run: |
terraform init -reconfigure
terraform state push -lock=false current.tfstate
generate-action:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8b0021a

Please sign in to comment.