diff --git a/action.yml b/action.yml index 654a4ab4..2b8ae194 100644 --- a/action.yml +++ b/action.yml @@ -72,7 +72,7 @@ inputs: terragrunt-version: description: Terragrunt version required: false - default: v0.55.5 + default: v0.73.7 opentofu-version: description: OpenTofu version required: false @@ -272,6 +272,7 @@ runs: format('{0}/cache', github.workspace) || inputs.terraform-cache-dir }} echo "TF_PLUGIN_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV + echo "TG_PROVIDER_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV echo "TERRAGRUNT_PROVIDER_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV - uses: actions/cache/restore@v4 @@ -400,6 +401,7 @@ runs: INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL: ${{ inputs.drift-detection-slack-notification-url }} NO_BACKEND: ${{ inputs.no-backend }} DEBUG: 'true' + TG_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }} TERRAGRUNT_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }} DIGGER_RUN_SPEC: ${{inputs.digger-spec}} run: | @@ -439,6 +441,7 @@ runs: INPUT_DIGGER_COMMAND: ${{ inputs.command }} INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL: ${{ inputs.drift-detection-slack-notification-url }} NO_BACKEND: ${{ inputs.no-backend }} + TG_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }} TERRAGRUNT_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }} DIGGER_RUN_SPEC: ${{inputs.digger-spec}} id: digger @@ -460,7 +463,7 @@ runs: with: path: $TF_PLUGIN_CACHE_DIR key: digger-cache-${{ hashFiles('**/cache') }} - + branding: icon: globe color: purple diff --git a/cli/pkg/digger/digger.go b/cli/pkg/digger/digger.go index b097319b..3d2dc2b8 100644 --- a/cli/pkg/digger/digger.go +++ b/cli/pkg/digger/digger.go @@ -3,6 +3,12 @@ package digger import ( "errors" "fmt" + "log" + "os" + "path" + "strings" + "time" + "github.com/diggerhq/digger/libs/backendapi" "github.com/diggerhq/digger/libs/ci" comment_updater "github.com/diggerhq/digger/libs/comment_utils/summary" @@ -12,11 +18,6 @@ import ( "github.com/diggerhq/digger/libs/policy" orchestrator "github.com/diggerhq/digger/libs/scheduler" "github.com/diggerhq/digger/libs/storage" - "log" - "os" - "path" - "strings" - "time" core_drift "github.com/diggerhq/digger/cli/pkg/core/drift" "github.com/diggerhq/digger/cli/pkg/usage" @@ -68,7 +69,8 @@ func RunJobs(jobs []orchestrator.Job, prService ci.PullRequestService, orgServic defer reporter.Flush() log.Printf("Info: [TF_PLUGIN_CACHE_DIR=%v] ", os.Getenv("TF_PLUGIN_CACHE_DIR")) - log.Printf("Info: [TERRAGRUNT_PROVIDER_CACHE_DIR=%v", os.Getenv("TERRAGRUNT_PROVIDER_CACHE_DIR")) + log.Printf("Info: [TG_PROVIDER_CACHE_DIR=%v] ", os.Getenv("TG_PROVIDER_CACHE_DIR")) + log.Printf("Info: [TERRAGRUNT_PROVIDER_CACHE_DIR=%v] ", os.Getenv("TERRAGRUNT_PROVIDER_CACHE_DIR")) runStartedAt := time.Now() diff --git a/libs/execution/terragrunt.go b/libs/execution/terragrunt.go index d5136afa..4fb84f04 100644 --- a/libs/execution/terragrunt.go +++ b/libs/execution/terragrunt.go @@ -104,9 +104,12 @@ func (terragrunt Terragrunt) runTerragruntCommand(command string, printOutputToS env := os.Environ() env = append(env, "TF_CLI_ARGS=-no-color") env = append(env, "TF_IN_AUTOMATION=true") + env = append(env, "TERRAGRUNT_FORWARD_TF_STDOUT=1") env = append(env, "TERRAGRUNT_NO_COLOR=true") env = append(env, "TERRAGRUNT_NON_INTERACTIVE=true") - env = append(env, "TERRAGRUNT_FORWARD_TF_STDOUT=1") + env = append(env, "TG_NO_COLOR=true") + env = append(env, "TG_NON_INTERACTIVE=true") + env = append(env, "TG_TF_FORWARD_STDOUT=true") for k, v := range envs { env = append(env, fmt.Sprintf("%s=%s", k, v))