Update Terraform workflow file paths and output handling
- Change single quotes to double quotes in path filters for consistency - Modify command redirection to use > instead of | tee for cleaner output handling - Add explicit cat command to display plan output in logs - Standardize whitespace formatting throughout files
This commit is contained in:
@@ -5,8 +5,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
paths:
|
paths:
|
||||||
- 'terraform/**'
|
- "terraform/**"
|
||||||
- '.gitea/workflows/terraform-*.yml'
|
- ".gitea/workflows/terraform-*.yml"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TF_WORKING_DIR: terraform/prod
|
TF_WORKING_DIR: terraform/prod
|
||||||
@@ -89,8 +89,9 @@ jobs:
|
|||||||
id: plan
|
id: plan
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
terraform plan -input=false -no-color -detailed-exitcode -out=tfplan 2>&1 | tee plan_output.txt
|
terraform plan -input=false -no-color -detailed-exitcode -out=tfplan > plan_output.txt 2>&1
|
||||||
EXITCODE=$?
|
EXITCODE=$?
|
||||||
|
cat plan_output.txt
|
||||||
|
|
||||||
# Determine if there are changes
|
# Determine if there are changes
|
||||||
if [ $EXITCODE -eq 2 ]; then
|
if [ $EXITCODE -eq 2 ]; then
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
paths:
|
paths:
|
||||||
- 'terraform/**'
|
- "terraform/**"
|
||||||
- '.gitea/workflows/terraform-*.yml'
|
- ".gitea/workflows/terraform-*.yml"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TF_WORKING_DIR: terraform/prod
|
TF_WORKING_DIR: terraform/prod
|
||||||
@@ -87,8 +87,9 @@ jobs:
|
|||||||
id: plan
|
id: plan
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
terraform plan -input=false -no-color -detailed-exitcode -out=tfplan 2>&1 | tee plan_output.txt
|
terraform plan -input=false -no-color -detailed-exitcode -out=tfplan > plan_output.txt 2>&1
|
||||||
EXITCODE=$?
|
EXITCODE=$?
|
||||||
|
cat plan_output.txt
|
||||||
echo "exitcode=${EXITCODE}" >> $GITHUB_OUTPUT
|
echo "exitcode=${EXITCODE}" >> $GITHUB_OUTPUT
|
||||||
if [ $EXITCODE -eq 1 ]; then
|
if [ $EXITCODE -eq 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user