Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions clean-up/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Clean up Terraform files

description: >
Cleans up Terraform workspace files. This can be useful in certain cases when running Terraform multiple times in the
same directory may otherwise have unwanted side effects.

inputs:
directory:
description: The directory containing the Terraform configuration.
required: false
default: .
remove-backend-tf:
description: Whether or not to remove the backend.tf file.
required: false
default: 'true'

runs:
using: composite
steps:
- name: Remove .terraform directory
shell: bash
working-directory: ${{ inputs.directory }}
run: rm -rf .terraform

- name: Remove backend.tf file
if: inputs.remove-backend-tf == 'true'
shell: bash
working-directory: ${{ inputs.directory }}
run: rm backend.tf
Loading