Skip to content

Commit 80544bf

Browse files
committed
Fix working-directory for Tofu commands
1 parent 9a5c057 commit 80544bf

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

.github/workflows/ci-iac.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
tofu_version: ${{ env.tf_version }}
8282

8383
- name: Tofu Format
84-
working-directory: iac
84+
working-directory: iac/app
8585
run: tofu fmt -check -recursive
8686

8787
plan:
@@ -126,24 +126,24 @@ jobs:
126126
tofu_version: ${{ env.tf_version }}
127127

128128
- name: Tofu Init
129-
working-directory: ${{ matrix.env.tf_working_dir }}
129+
working-directory: iac/app
130130
run: tofu init -var-file=${{ matrix.env.environment_name }}.tfvars
131131

132132
- name: Tofu Plan
133-
working-directory: ${{ matrix.env.tf_working_dir }}
133+
working-directory: iac/app
134134
run: tofu plan -var-file=${{ matrix.env.environment_name }}.tfvars -input=false -out plan -lock=false
135135

136136
- name: Comment Tofu Plan
137137
uses: byu-oit/github-action-tf-plan-comment@v1
138138
with:
139139
github-token: ${{ secrets.GITHUB_TOKEN }}
140-
working-directory: ${{ matrix.env.tf_working_dir }}
140+
working-directory: iac/app
141141
terraform-plan-file: plan
142142

143143
- name: Analyze Tofu Plan
144144
uses: byu-oit/github-action-tf-plan-analyzer@v2
145145
with:
146-
working-directory: ${{ matrix.env.tf_working_dir }}
146+
working-directory: iac/app
147147
terraform-plan-file: plan
148148
divvycloud-username: ${{ secrets.DIVVYCLOUD_USERNAME }}
149149
divvycloud-password: ${{ secrets.DIVVYCLOUD_PASSWORD }}

.github/workflows/deploy.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,23 @@ jobs:
153153
tofu_wrapper: false
154154

155155
- name: Tofu Init
156-
working-directory: ${{ matrix.env.tf_working_dir }}
156+
working-directory: iac/app
157157
run: tofu init -var-file=${{ matrix.env.environment_name }}.tfvars
158158

159159
- name: Tofu Format
160-
working-directory: "./"
160+
working-directory: iac/app
161161
run: tofu fmt -check -recursive
162162

163163
- name: Tofu Plan
164-
working-directory: ${{ matrix.env.tf_working_dir }}
164+
working-directory: iac/app
165165
run: tofu plan -var-file=${{ matrix.env.environment_name }}.tfvars -input=false -out=plan
166166

167167
- name: Analyze Tofu Plan
168168
uses: byu-oit/github-action-tf-plan-analyzer@v2
169169
if: github.repository_owner == 'byu-oit'
170170
# If you're at BYU, but outside the byu-oit GitHub org, you may be able to obtain credentials by contacting [email protected]
171171
with:
172-
working-directory: ${{ matrix.env.tf_working_dir }}
172+
working-directory: iac/app
173173
terraform-plan-file: plan
174174
divvycloud-username: ${{ secrets.DIVVYCLOUD_USERNAME }}
175175
divvycloud-password: ${{ secrets.DIVVYCLOUD_PASSWORD }}
@@ -183,12 +183,12 @@ jobs:
183183
template-id: ${{ matrix.env.rfc_template_id }}
184184

185185
- name: Tofu Apply
186-
working-directory: ${{ matrix.env.tf_working_dir }}
186+
working-directory: iac/app
187187
run: tofu apply plan
188188

189189
- name: Get Tofu Outputs
190190
id: tofu-outputs
191-
working-directory: ${{ matrix.env.tf_working_dir }}
191+
working-directory: iac/app
192192
run: |
193193
echo "codedeploy_app_name=$(tofu output -var-file=${{ matrix.env.environment_name }}.tfvars -raw codedeploy_app_name)" >> $GITHUB_OUTPUT
194194
echo "codedeploy_deployment_group_name=$(tofu output -var-file=${{ matrix.env.environment_name }}.tfvars -raw codedeploy_deployment_group_name)" >> $GITHUB_OUTPUT
@@ -212,4 +212,3 @@ jobs:
212212
change-sys-id: ${{ steps.start-standard-change.outputs.change-sys-id }}
213213
work-start: ${{ steps.start-standard-change.outputs.work-start }}
214214
success: ${{ job.status == 'success' }}
215-

0 commit comments

Comments
 (0)