Skip to content

Commit

Permalink
Disable shell mode, too hard to read
Browse files Browse the repository at this point in the history
Remove "not found" statement, too noisy and hard to grep

Signed-off-by: Jacob Woffenden <[email protected]>
  • Loading branch information
jacobwoffenden committed Oct 23, 2024
1 parent ffa54db commit 4f39f25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable_terraform_plan_apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
working-directory: "terraform/environments/${{ inputs.application }}"
shell: bash
run: |
bash -x ${GITHUB_WORKSPACE}/scripts/terraform-plan-evaluator.sh tfplan.json
bash ${GITHUB_WORKSPACE}/scripts/terraform-plan-evaluator.sh tfplan.json
- name: Create Plan PR message (Optional)
if: github.event_name == 'pull_request' && steps.plan.outputs.exitcode == '2' && inputs.post_plan_to_pr == true
Expand Down
3 changes: 1 addition & 2 deletions scripts/terraform-plan-evaluator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ RESOURCES_TO_CHECK_FOR=(
resourcesFound=false

for resource in "${RESOURCES_TO_CHECK_FOR[@]}"; do
echo "Checking for resource: ${resource}"
checkForResource=$(jq -r --arg resourceType "${resource}" '.resource_changes[] | select(.type == $resourceType) | .change.actions[] | select(. != "no-op" and . != "read")' "${TERRAFORM_PLAN}")
if [[ -n "${checkForResource}" ]]; then
echo "Resource ${resource} found in plan"
resourcesFound=true
else
echo "Resource ${resource} not found in plan"
fi
done

Expand Down

0 comments on commit 4f39f25

Please sign in to comment.