Skip to content

Commit 978d882

Browse files
[NDR-56] Refactor Terraform CI workflow to remove continue-on-error flags for format, validate, and plan steps, ensuring clearer error handling in the process
1 parent 4045ddc commit 978d882

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

.github/workflows/terraform-dev-to-main-ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ jobs:
6262
id: fmt
6363
run: terraform fmt -check
6464
working-directory: ./infrastructure
65-
continue-on-error: true
6665

6766
- name: terraform validate
6867
id: validate
6968
run: terraform validate -no-color
70-
continue-on-error: true
7169

7270
- name: Terraform Plan
7371
id: plan
@@ -77,7 +75,6 @@ jobs:
7775
echo "summary=$(grep -E 'Plan: [0-9]+ to add, [0-9]+ to change, [0-9]+ to destroy\.|No changes\. Your infrastructure matches the configuration\.' tfplan.txt | sed 's/.*No changes\. Your infrastructure matches the configuration/Plan: no changes/g' | sed 's/.*Plan: //g' | sed 's/\..*//g')" >> $GITHUB_OUTPUT
7876
working-directory: ./infrastructure
7977
shell: bash
80-
continue-on-error: true
8178

8279
- name: Truncate Plan Output
8380
id: plan-truncated
@@ -97,7 +94,7 @@ jobs:
9794

9895
- name: Add PR comment
9996
uses: actions/github-script@v7
100-
if: github.event_name == 'pull_request'
97+
if: github.event_name == 'pull_request' && (success() || failure())
10198
with:
10299
github-token: ${{ secrets.GITHUB_TOKEN }}
103100
script: |

0 commit comments

Comments
 (0)