hashicorp / setup-terraform

Sets up Terraform CLI in your GitHub Actions workflow.
https://developer.hashicorp.com/terraform/tutorials/automation/github-actions
Mozilla Public License 2.0
1.39k stars 243 forks source link

feat: add post-job step for cleaning temp dir #384

Open sfreydin opened 11 months ago

sfreydin commented 11 months ago

Add post-job step for cleaning temp dir

Description

By default, setup-terraform action is downloading terraform file to temporary directory. It should be cleaned in the self-hosted runners because it gets cluttered with unused file with time. Also, I can't set condition into action.yaml to runs.post-if directive due to issue

Changes Made

How to Use

  1. Set parameter cleanup_workspace.

Example workflow configuration:

steps:
- uses: hashicorp/setup-terraform@v3
  with:
     cleanup_workspace: true
hashicorp-cla commented 11 months ago

CLA assistant check
All committers have signed the CLA.