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:
|
||||
- dev
|
||||
paths:
|
||||
- 'terraform/**'
|
||||
- '.gitea/workflows/terraform-*.yml'
|
||||
- "terraform/**"
|
||||
- ".gitea/workflows/terraform-*.yml"
|
||||
|
||||
env:
|
||||
TF_WORKING_DIR: terraform/prod
|
||||
@@ -89,16 +89,17 @@ jobs:
|
||||
id: plan
|
||||
run: |
|
||||
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=$?
|
||||
|
||||
cat plan_output.txt
|
||||
|
||||
# Determine if there are changes
|
||||
if [ $EXITCODE -eq 2 ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
|
||||
# Exit 1 is error, 0 and 2 are OK
|
||||
if [ $EXITCODE -eq 1 ]; then
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user