dflook/terraform-plan
Create a Terraform plan
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Maintainedlast commit Jan 13, 2026
- License
- None
Pinned Snippet
uses: dflook/terraform-plan@7878bff63e2099cdc9be9a6f33cbbbf687f8f0fe # v2.2.3tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| path | The path to the Terraform root module to generate a plan for. | no | . |
| workspace | Terraform workspace to run the plan for. | no | default |
| label | A 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 | "" |
| variables | Variables 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_file | List of tfvars files to use, one per line. Paths should be relative to the GitHub Actions workspace | no | — |
| backend_config | List of Terraform backend config values, one per line. | no | "" |
| backend_config_file | List of Terraform backend config files to use, one per line. Paths should be relative to the GitHub Actions workspace | no | "" |
| replace | List of resources to replace, one per line. | no | "" |
| target | List of resources to target, one per line. The plan will be limited to these resources and their dependencies. | no | "" |
| destroy | Set 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). | no | false |
| refresh | Set 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. | no | true |
| add_github_comment | Controls 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. | no | true |
| parallelism | Limit the number of concurrent operations | no | 0 |
Outputs
| name | description |
|---|---|
| changes | Set to 'true' if the plan would apply any changes, 'false' if it wouldn't. |
| plan_path | This 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_path | This 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_path | This is the path to the generated plan in a human-readable format. The path is relative to the Actions workspace. |
| to_add | The number of resources that would be affected by this operation. |
| to_change | The number of resources that would be affected by this operation. |
| to_destroy | The number of resources that would be affected by this operation. |
| to_move | The number of resources that would be affected by this operation. |
| to_import | The number of resources that would be affected by this operation. |
| run_id | If the root module uses the `remote` or `cloud` backend in remote execution mode, this output will be set to the remote run id. |