dflook/terraform-plan

Create a Terraform plan

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Maintainedlast commit Jan 13, 2026
License
None

Pinned Snippet

workflow.ymlSHA-pinned
uses: dflook/terraform-plan@7878bff63e2099cdc9be9a6f33cbbbf687f8f0fe # v2.2.3

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

namedescriptionrequireddefault
pathThe path to the Terraform root module to generate a plan for.no.
workspaceTerraform workspace to run the plan for.nodefault
labelA friendly name for the environment the Terraform configuration is for. This will be used in the PR comment for easy identification. If this is set, it must be the same as the `label` used in any corresponding [`dflook/terraform-apply`](https://github.com/dflook/terraform-github-actions/tree/main/terraform-apply) action. no""
variablesVariables to set for the terraform plan. This should be valid Terraform syntax - like a [variable definition file](https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files). Variables set here override any given in `var_file`s. no
var_fileList of tfvars files to use, one per line. Paths should be relative to the GitHub Actions workspace no
backend_configList of Terraform backend config values, one per line.no""
backend_config_fileList of Terraform backend config files to use, one per line. Paths should be relative to the GitHub Actions workspace no""
replaceList of resources to replace, one per line.no""
targetList of resources to target, one per line. The plan will be limited to these resources and their dependencies. no""
destroySet to `true` to generate a plan to destroy all resources. This generates a plan in [destroy mode](https://developer.hashicorp.com/terraform/cli/commands/plan#planning-modes). nofalse
refreshSet to `false` to skip synchronisation of the Terraform state with actual resources. This will make the plan faster but may be out of date with the actual resources, which can lead to incorrect plans. notrue
add_github_commentControls whether a comment is added to the PR with the generated plan. The default is `true`, which adds a comment to the PR with the results of the plan. Set to `changes-only` to add a comment only when the plan indicates there are changes to apply. Set to `always-new` to always create a new comment for each plan, instead of updating the previous comment. Set to `false` to disable the comment - the plan will still appear in the workflow log. notrue
parallelismLimit the number of concurrent operationsno0
namedescription
changesSet to 'true' if the plan would apply any changes, 'false' if it wouldn't.
plan_pathThis is the path to the generated plan in an opaque binary format. The path is relative to the Actions workspace. The plan can be used as the `plan_file` input to the [dflook/terraform-apply](https://github.com/dflook/terraform-github-actions/tree/main/terraform-apply) action. Terraform plans often contain sensitive information, so this output should be treated with care.
json_plan_pathThis is the path to the generated plan in [JSON Output Format](https://www.terraform.io/docs/internals/json-format.html). The path is relative to the Actions workspace. Terraform plans often contain sensitive information, so this output should be treated with care.
text_plan_pathThis is the path to the generated plan in a human-readable format. The path is relative to the Actions workspace.
to_addThe number of resources that would be affected by this operation.
to_changeThe number of resources that would be affected by this operation.
to_destroyThe number of resources that would be affected by this operation.
to_moveThe number of resources that would be affected by this operation.
to_importThe number of resources that would be affected by this operation.
run_idIf the root module uses the `remote` or `cloud` backend in remote execution mode, this output will be set to the remote run id.