{"id":29635099,"url":"https://github.com/dflook/tofu-refresh","last_synced_at":"2026-02-07T14:02:38.357Z","repository":{"id":283215461,"uuid":"947848984","full_name":"dflook/tofu-refresh","owner":"dflook","description":"Github action to refresh OpenTofu state","archived":false,"fork":false,"pushed_at":"2025-08-08T13:30:58.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T16:49:09.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dflook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["dflook"]}},"created_at":"2025-03-13T10:45:43.000Z","updated_at":"2025-11-27T01:53:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"73530c86-86b2-4f57-be9d-69b50b57ac75","html_url":"https://github.com/dflook/tofu-refresh","commit_stats":null,"previous_names":["dflook/tofu-refresh"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/dflook/tofu-refresh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflook","download_url":"https://codeload.github.com/dflook/tofu-refresh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-refresh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29196625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T16:09:48.904Z","updated_at":"2026-02-07T14:02:38.343Z","avatar_url":"https://github.com/dflook.png","language":null,"funding_links":["https://github.com/sponsors/dflook"],"categories":[],"sub_categories":[],"readme":"# tofu-refresh action\n\nThis is one of a suite of OpenTofu related actions - find them at [dflook/terraform-github-actions](https://github.com/dflook/terraform-github-actions).\n\nThis actions runs an OpenTofu apply operation in refresh-only mode.\nThis will synchronise the OpenTofu state with the actual resources, but will not make any changes to the resources.\n\n## Inputs\n\n* `path`\n\n  Path to the OpenTofu root module to refresh state for\n\n  - Type: string\n  - Optional\n  - Default: The action workspace\n\n* `workspace`\n\n  OpenTofu workspace to run the refresh state in\n\n  - Type: string\n  - Optional\n  - Default: `default`\n\n* `variables`\n\n  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).\n\n  Variables set here override any given in `var_file`s.\n\n  ```yaml\n  with:\n    variables: |\n      image_id = \"${{ secrets.AMI_ID }}\"\n      availability_zone_names = [\n        \"us-east-1a\",\n        \"us-west-1c\",\n      ]\n  ```\n\n  - Type: string\n  - Optional\n\n* `var_file`\n\n  List of tfvars files to use, one per line.\n  Paths should be relative to the GitHub Actions workspace\n\n  ```yaml\n  with:\n    var_file: |\n      common.tfvars\n      prod.tfvars\n  ```\n\n  - Type: string\n  - Optional\n\n* `backend_config`\n\n  List of OpenTofu backend config values, one per line.\n\n  ```yaml\n  with:\n    backend_config: token=${{ secrets.BACKEND_TOKEN }}\n  ```\n\n  - Type: string\n  - Optional\n\n* `backend_config_file`\n\n  List of OpenTofu backend config files to use, one per line.\n  Paths should be relative to the GitHub Actions workspace\n\n  ```yaml\n  with:\n    backend_config_file: prod.backend.tfvars\n  ```\n\n  - Type: string\n  - Optional\n\n* `target`\n\n  List of resources to target, one per line.\n  The refresh will be limited to these resources and their dependencies.\n\n  ```yaml\n  with:\n    target: |\n      kubernetes_secret.tls_cert_public\n      kubernetes_secret.tls_cert_private\n  ```\n\n  - Type: string\n  - Optional\n\n* `exclude`\n\n  List of resources to exclude from the refresh operation, one per line.\n  The refresh will include all resources except the specified ones and their dependencies.\n\n  Requires OpenTofu 1.9+.\n\n  ```yaml\n  with:\n    exclude: |\n      local_file.sensitive_config\n      aws_instance.temp_resource\n  ```\n\n  - Type: string\n  - Optional\n\n* `parallelism`\n\n  Limit the number of concurrent operations\n\n  - Type: number\n  - Optional\n  - Default: The OpenTofu default (10).\n\n## Outputs\n\n* `failure-reason`\n\n  When the job outcome is `failure`, this output may be set. The value may be one of:\n\n  - `refresh-failed` - The OpenTofu apply operation failed.\n  - `state-locked` - The Terraform state lock could not be obtained because it was already locked.\n\n  If the job fails for any other reason this will not be set.\n  This can be used with the Actions expression syntax to conditionally run steps.\n\n  - Type: string\n\n* `lock-info`\n\n  When the job outcome is `failure` and the failure-reason is `state-locked`, this output will be set.\n\n  It is a json object containing any available state lock information and typically has the form:\n\n  ```json\n  {\n    \"ID\": \"838fbfde-c5cd-297f-84a4-d7578b4a4880\",\n    \"Path\": \"terraform-github-actions/test-unlock-state\",\n    \"Operation\": \"OperationTypeApply\",\n    \"Who\": \"root@e9d43b0c6478\",\n    \"Version\": \"1.3.7\",\n    \"Created\": \"2023-01-28 00:16:41.560904373 +0000 UTC\",\n    \"Info\": \"\"\n  }\n  ```\n\n  - Type: string\n\n* `run_id`\n\n  If the root module uses the `remote` or `cloud` backend in remote execution mode, this output will be set to the remote run id.\n\n  - Type: string\n\n## Environment Variables\n\n* `GITHUB_DOT_COM_TOKEN`\n\n  This is used to specify a token for GitHub.com when the action is running on a GitHub Enterprise instance.\n  This is only used for downloading OpenTofu binaries from GitHub.com.\n  If this is not set, an unauthenticated request will be made to GitHub.com to download the binary, which may be rate limited.\n\n  - Type: string\n  - Optional\n\n* `TERRAFORM_CLOUD_TOKENS`\n\n  API tokens for cloud hosts, of the form `\u003chost\u003e=\u003ctoken\u003e`. Multiple tokens may be specified, one per line.\n  These tokens may be used with the `remote` backend and for fetching required modules from the registry.\n\n  e.g:\n\n  ```yaml\n  env:\n    TERRAFORM_CLOUD_TOKENS: app.terraform.io=${{ secrets.TF_CLOUD_TOKEN }}\n  ```\n\n  With other registries:\n\n  ```yaml\n  env:\n    TERRAFORM_CLOUD_TOKENS: |\n      app.terraform.io=${{ secrets.TF_CLOUD_TOKEN }}\n      tofu.example.com=${{ secrets.TF_REGISTRY_TOKEN }}\n  ```\n\n  - Type: string\n  - Optional\n\n* `TERRAFORM_SSH_KEY`\n\n  A SSH private key that OpenTofu will use to fetch git/mercurial module sources.\n\n  This should be in PEM format.\n\n  For example:\n\n  ```yaml\n  env:\n    TERRAFORM_SSH_KEY: ${{ secrets.TERRAFORM_SSH_KEY }}\n  ```\n\n  - Type: string\n  - Optional\n\n* `TERRAFORM_HTTP_CREDENTIALS`\n\n  Credentials that will be used for fetching modules sources with `git::http://`, `git::https://`, `http://` \u0026 `https://` schemes.\n\n  Credentials have the format `\u003chost\u003e=\u003cusername\u003e:\u003cpassword\u003e`. Multiple credentials may be specified, one per line.\n\n  Each credential is evaluated in order, and the first matching credentials are used.\n\n  Credentials that are used by git (`git::http://`, `git::https://`) allow a path after the hostname.\n  Paths are ignored by `http://` \u0026 `https://` schemes.\n  For git module sources, a credential matches if each mentioned path segment is an exact match.\n\n  For example:\n\n  ```yaml\n  env:\n    TERRAFORM_HTTP_CREDENTIALS: |\n      example.com=dflook:${{ secrets.HTTPS_PASSWORD }}\n      github.com/dflook/terraform-github-actions.git=dflook-actions:${{ secrets.ACTIONS_PAT }}\n      github.com/dflook=dflook:${{ secrets.DFLOOK_PAT }}\n      github.com=graham:${{ secrets.GITHUB_PAT }}  \n  ```\n\n  - Type: string\n  - Optional\n\n* `TERRAFORM_PRE_RUN`\n\n  A set of commands that will be ran prior to `tofu init`. This can be used to customise the environment before running OpenTofu.\n\n  The runtime environment for these actions is subject to change in minor version releases. If using this environment variable, specify the minor version of the action to use.\n\n  The runtime image is currently based on `debian:bookworm`, with the command run using `bash -xeo pipefail`.\n\n  For example:\n\n  ```yaml\n  env:\n    TERRAFORM_PRE_RUN: |\n      # Install latest Azure CLI\n      curl -skL https://aka.ms/InstallAzureCLIDeb | bash\n\n      # Install postgres client\n      apt-get install -y --no-install-recommends postgresql-client\n  ```\n\n  - Type: string\n  - Optional\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflook%2Ftofu-refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflook%2Ftofu-refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflook%2Ftofu-refresh/lists"}