7factor/Run Terraform

Runs various Terraform commands using the Terraform CLI.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Feb 10, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: 7factor/action-terraform@3b89a273371ae434962a65fa9dcafc99dddd8cf2 # v3.2.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
github-tokenThe GitHub token to useno${{ github.token }}
tf-cliThe actual Terraform cli to usenoterraform
directoryThe directory containing the Terraform configurationno.
workspaceThe Terraform workspace to useno
workspace-selectWhether to run terraform workspace select. Requires workspace input and the TF_WORKSPACE env var to not be set. notrue
workspace-create-if-missingWhether to create the workspace if it does not exist. Requires workspace-select input to be true.notrue
initWhether to run terraform initnotrue
init-argsAdditional arguments to pass to terraform initno
backend-fileThe path to the backend file to use, if not present in the terraform config directory.no
partial-backendThe backend to use in a partial backend configuration. For example, "s3". See https://developer.hashicorp.com/terraform/language/backend#partial-configuration no
backend-config-contentThe content of the backend config file to use. For use with partial backend configuration. See https://developer.hashicorp.com/terraform/language/backend#partial-configuration no
fmtWhether to run terraform fmtnotrue
validateWhether to run terraform validatenotrue
actionThe main terraform action to run ("plan", "apply", "test", or "output")no
action-argsAdditional arguments to pass to terraform plan, apply, test, or outputno
destroyWhether to destroy the infrastructurenofalse
outputWhether to run terraform output separate from the main action (for logging purposes)nofalse
output-argsAdditional arguments to pass to terraform output (for the output input)no
metadataWhether to run terraform output in JSON format and produce a flattened "metadata" output that can be used as json tfvars. nofalse
tfvars-contentThe content of the variable file to use.no
tfvars-json-contentThe content of the variable file to use in JSON format.no
plan-file-nameThe name to the plan file to use. If not provided, a plan file will not be used.no
encrypted-plan-passwordThe password to use to encrypt the plan artifact. If not provided, the plan will not be encrypted.no
plan-retention-daysDuration after which the plan artifact will expire in days. 0 means using the default value defined in the repository settings. Actual values can range from 1 to 90 (public repositories) or 400 (private repositories). no0
commentWhether to comment on the PR with the resultsnotrue
comment-headerThe header to use in the PR commentno
comment-identifierThe identifier to use in the PR commentno
namedescription
fmt-outcomeThe outcome of the terraform fmt command
fmt-stdoutThe stdout of the terraform fmt command
fmt-stderrThe stderr of the terraform fmt command
init-outcomeThe outcome of the terraform init command
init-stdoutThe stdout of the terraform init command
init-stderrThe stderr of the terraform init command
workspace-outcomeThe outcome of the terraform workspace select command
workspace-stdoutThe stdout of the terraform workspace select command
workspace-stderrThe stderr of the terraform workspace select command
validate-outcomeThe outcome of the terraform validate command
validate-stdoutThe stdout of the terraform validate command
validate-stderrThe stderr of the terraform validate command
test-outcomeThe outcome of the terraform test command
test-stdoutThe stdout of the terraform test command
test-stderrThe stderr of the terraform test command
plan-outcomeThe outcome of the terraform plan command
plan-stdoutThe stdout of the terraform plan command
plan-stderrThe stderr of the terraform plan command
apply-outcomeThe outcome of the terraform apply command
apply-stdoutThe stdout of the terraform apply command
apply-stderrThe stderr of the terraform apply command
output-outcomeThe outcome of the terraform output command
output-stdoutThe stdout of the terraform output command
output-stderrThe stderr of the terraform output command
metadataThe metadata (output vars in JSON format) from the terraform state