Skip to content

Commit

Permalink
Exclude read actions from check
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <[email protected]>
  • Loading branch information
Jacob Woffenden committed Nov 17, 2023
1 parent 88cc9eb commit 5db4a51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/terraform-plan-evaluator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RESOURCES_TO_CHECK_FOR=(
resourcesFound=false

for resource in "${RESOURCES_TO_CHECK_FOR[@]}"; do
checkForResource=$(jq -r --arg resourceType "${resource}" '.resource_changes[] | select(.type == $resourceType) | .change.actions[] | select(. != "no-op")' "${TERRAFORM_PLAN}")
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
Expand Down

0 comments on commit 5db4a51

Please sign in to comment.