Skip to content

Commit 121d61e

Browse files
committed
refactor: move terraform configuration to terraform subdirectory
1 parent 3a8a69f commit 121d61e

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

.github/workflows/terraform.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ env:
4444
GITHUB_APP_INSTALLATION_ID: ${{ inputs.gh_app_installation_id || vars.GH_APP_INSTALLATION_ID }}
4545
GITHUB_APP_PEM_FILE: ${{ secrets.gh_app_pem_file || secrets.GH_APP_PEM_FILE }}
4646
TF_WORKSPACE: ${{ inputs.gh_owner || vars.GH_OWNER }}
47-
TF_VAR_path: iac/${{ inputs.path || 'test.yaml' }}
47+
TF_VAR_path: ../iac/${{ inputs.path || 'test.yaml' }}
4848

4949
jobs:
5050
terraform:
@@ -74,12 +74,12 @@ jobs:
7474

7575
- name: Terraform init
7676
id: init
77-
run: terraform init
77+
run: terraform -chdir=terraform init
7878

7979
- name: Terraform plan
8080
id: plan
8181
if: github.event_name == 'pull_request'
82-
run: terraform plan -no-color -input=false
82+
run: terraform -chdir=terraform plan -no-color -input=false
8383
continue-on-error: true
8484

8585
- name: Terraform plan as the PR comment
@@ -138,4 +138,4 @@ jobs:
138138

139139
- name: Terraform apply
140140
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
141-
run: terraform apply -auto-approve -input=false
141+
run: terraform -chdir=terraform apply -auto-approve -input=false

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ export GITHUB_APP_PEM_FILE=$(cat <app-private-key.pem>)
211211
export TF_WORKSPACE="$GITHUB_OWNER"
212212
export TF_VAR_path="test.yaml"
213213
214-
terraform init
215-
terraform plan
216-
terraform apply
214+
terraform -chdir=terraform init
215+
terraform -chdir=terraform plan
216+
terraform -chdir=terraform apply
217217
```
218218

219219
## Testing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)