From 852712635bf83d3b7d4b2c9a3686fc46c2051f3a Mon Sep 17 00:00:00 2001
From: Timo Furrer <tfurrer@gitlab.com>
Date: Wed, 13 Nov 2024 15:44:07 +0100
Subject: [PATCH] Rename internal `JQ_PLAN` variable

---
 src/gitlab-tofu.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gitlab-tofu.sh b/src/gitlab-tofu.sh
index c13e6c0..47e4c3b 100644
--- a/src/gitlab-tofu.sh
+++ b/src/gitlab-tofu.sh
@@ -125,7 +125,7 @@ if [ -n "$TF_ADDRESS" ]; then
   fi
 fi
 
-JQ_PLAN='
+jq_plan='
   (
     [.resource_changes[]?.change.actions?] | flatten
   ) | {
@@ -300,7 +300,7 @@ if [ $sourced -eq 0 ]; then
 
       if [ "${GITLAB_TOFU_PLAN_WITH_JSON}" = 'true' ]; then
         if [ "$ret" -eq 0 ] || [ "$ret" -eq 2 ]; then
-          if ! tofu "${tf_chdir_opt}" show -json "${GITLAB_TOFU_PLAN_CACHE}" | jq -r "${JQ_PLAN}" > "${GITLAB_TOFU_PLAN_JSON}"; then
+          if ! tofu "${tf_chdir_opt}" show -json "${GITLAB_TOFU_PLAN_CACHE}" | jq -r "${jq_plan}" > "${GITLAB_TOFU_PLAN_JSON}"; then
             exit $?
           fi
 
@@ -312,7 +312,7 @@ if [ $sourced -eq 0 ]; then
       exit "$ret"
     ;;
     "plan-json")
-      tofu "${tf_chdir_opt}" show -json "${GITLAB_TOFU_PLAN_CACHE}" | jq -r "${JQ_PLAN}" > "${GITLAB_TOFU_PLAN_JSON}"
+      tofu "${tf_chdir_opt}" show -json "${GITLAB_TOFU_PLAN_CACHE}" | jq -r "${jq_plan}" > "${GITLAB_TOFU_PLAN_JSON}"
     ;;
     "validate")
       $GITLAB_TOFU_IMPLICIT_INIT && terraform_init -backend=false
-- 
GitLab