dflook/tofu-refresh

Refresh OpenTofu state

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/tofu-refresh@e06d5700ed8f91ca4381bf22bfb88edc78dd4d26 # v2.2.3

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

namedescriptionrequireddefault
pathPath to the OpenTofu root module to refresh state forno.
workspaceOpenTofu workspace to run the refresh state innodefault
variablesVariables 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_fileList of tfvars files to use, one per line. Paths should be relative to the GitHub Actions workspace no
backend_configList of OpenTofu backend config values, one per line.no""
backend_config_fileList of OpenTofu backend config files to use, one per line. Paths should be relative to the GitHub Actions workspace no""
targetList of resources to target, one per line. The refresh will be limited to these resources and their dependencies. no""
excludeList 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""
parallelismLimit the number of concurrent operationsno0
namedescription
failure_reasonWhen 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-reasonWhen 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_infoWhen 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-infoWhen 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_idIf the root module uses the `remote` or `cloud` backend in remote execution mode, this output will be set to the remote run id.