Skip to content

Commit 88501a7

Browse files
committed
fix: chdir to terraform directory for ci runs
1 parent a948bbc commit 88501a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/terraform.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ jobs:
3232

3333
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
3434
- name: Terraform Init
35-
run: terraform init
35+
run: terraform -chdir=./terraform init
3636

3737
# Checks that all Terraform configuration files adhere to a canonical format
3838
- name: Terraform Format
39-
run: terraform fmt -check
39+
run: terraform -chdir=./terraform fmt -check
4040

4141
# Generates an execution plan for Terraform
4242
- name: Terraform Plan
43-
run: terraform plan -input=false
43+
run: terraform -chdir=./terraform plan -input=false
4444

4545
# On push to "main", build or change infrastructure according to Terraform configuration files
4646
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks
4747
- name: Terraform Apply
4848
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
49-
run: terraform apply -auto-approve -input=false
49+
run: terraform -chdir=./terraform apply -auto-approve -input=false

0 commit comments

Comments
 (0)