dflook/tofu-refresh
Refresh OpenTofu state
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Maintainedlast commit Jan 13, 2026
- License
- None
Pinned Snippet
uses: dflook/tofu-refresh@e06d5700ed8f91ca4381bf22bfb88edc78dd4d26 # v2.2.3tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| path | Path to the OpenTofu root module to refresh state for | no | . |
| workspace | OpenTofu workspace to run the refresh state in | no | default |
| variables | Variables to set for the tofu plan. This should be valid OpenTofu syntax - like a [variable definition file](https://opentofu.org/docs/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 OpenTofu backend config values, one per line. | no | "" |
| backend_config_file | List of OpenTofu backend config files to use, one per line. Paths should be relative to the GitHub Actions workspace | no | "" |
| target | List of resources to target, one per line. The refresh will be limited to these resources and their dependencies. | no | "" |
| exclude | List of resources to exclude from the refresh operation, one per line. The refresh will include all resources except the specified ones and their dependencies. Requires OpenTofu 1.9+. | no | "" |
| parallelism | Limit the number of concurrent operations | no | 0 |
Outputs
| name | description |
|---|---|
| failure_reason | When the job outcome is `failure`, this output may be set. The value may be one of: - `refresh-failed` - The OpenTofu apply operation failed. - `state-locked` - The Terraform state lock could not be obtained because it was already locked. If the job fails for any other reason this will not be set. This can be used with the Actions expression syntax to conditionally run steps. |
| failure-reason | When the job outcome is `failure`, this output may be set. The value may be one of: - `refresh-failed` - The OpenTofu apply operation failed. - `state-locked` - The Terraform state lock could not be obtained because it was already locked. If the job fails for any other reason this will not be set. This can be used with the Actions expression syntax to conditionally run steps. |
| lock_info | When the job outcome is `failure` and the failure_reason is `state-locked`, this output will be set. It is a json object containing any available state lock information and typically has the form: ```json { "ID": "838fbfde-c5cd-297f-84a4-d7578b4a4880", "Path": "terraform-github-actions/test-unlock-state", "Operation": "OperationTypeApply", "Who": "root@e9d43b0c6478", "Version": "1.3.7", "Created": "2023-01-28 00:16:41.560904373 +0000 UTC", "Info": "" } ``` |
| lock-info | When the job outcome is `failure` and the failure_reason is `state-locked`, this output will be set. It is a json object containing any available state lock information and typically has the form: ```json { "ID": "838fbfde-c5cd-297f-84a4-d7578b4a4880", "Path": "terraform-github-actions/test-unlock-state", "Operation": "OperationTypeApply", "Who": "root@e9d43b0c6478", "Version": "1.3.7", "Created": "2023-01-28 00:16:41.560904373 +0000 UTC", "Info": "" } ``` |
| 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. |