{"id":17923639,"url":"https://github.com/shmokmt/tfhk","last_synced_at":"2026-05-15T12:35:13.802Z","repository":{"id":217987093,"uuid":"744860291","full_name":"shmokmt/tfhk","owner":"shmokmt","description":"Terraform Housekeeper. The utility tool to  remove blocks for refactoring such as moved block.","archived":false,"fork":false,"pushed_at":"2026-02-24T05:41:44.000Z","size":52,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-26T05:07:32.063Z","etag":null,"topics":["devops","iac","infrastructure-as-code","sre","terraform"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/shmokmt/tfhk","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shmokmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-18T06:38:27.000Z","updated_at":"2026-02-24T05:41:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"37544b37-8930-43c9-8ac6-c6630136256d","html_url":"https://github.com/shmokmt/tfhk","commit_stats":null,"previous_names":["shmokmt/tfhk"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/shmokmt/tfhk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmokmt%2Ftfhk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmokmt%2Ftfhk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmokmt%2Ftfhk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmokmt%2Ftfhk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shmokmt","download_url":"https://codeload.github.com/shmokmt/tfhk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmokmt%2Ftfhk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["devops","iac","infrastructure-as-code","sre","terraform"],"created_at":"2024-10-28T20:44:50.435Z","updated_at":"2026-05-15T12:35:13.786Z","avatar_url":"https://github.com/shmokmt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfhk\n\n[![Go](https://github.com/shmokmt/tfhk/actions/workflows/go.yml/badge.svg)](https://github.com/shmokmt/tfhk/actions/workflows/go.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/shmokmt/tfhk.svg)](https://pkg.go.dev/github.com/shmokmt/tfhk)\n\nThe utility tool to remove blocks for refactoring such as moved blocks.\n\nSupports deletion of the following blocks.\n\n- moved block\n- import block\n- removed block\n\n# Usage\n\n```\ngo install github.com/shmokmt/tfhk/cmd/tfhk@latest\n```\n\n```\nUsage: tfhk [-recursive] [target]\n  -recursive\n        Also process files in subdirectories. By default, only the given directroy (or current directroy) is processed.\n```\n\nYou can also make a bot create a pull request using GitHub Actions.\nAn example workflow is shown below.\n\n\u003e [!TIP]\n\u003e If you want to trigger other actions, please use GitHub Apps or PAT.\n\u003e see also https://github.com/orgs/community/discussions/65321\n\n```yaml\nname: tfhk-pr\n\non:\n  workflow_dispatch:\n  schedule:\n   - cron: '0 1 * * 1'\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  create-pull-request:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v4\n\n    - uses: actions/setup-go@v5\n      with:\n        go-version: 'stable'\n\n    - uses: actions/create-github-app-token@v1\n      id: app-token\n      with:\n        app-id: ${{ secrets.TFHK_APP_ID }}\n        private-key: ${{ secrets.TFHK_PRIVATE_KEY }}\n\n    - name: Install tfhk\n      run: go install github.com/shmokmt/tfhk/cmd/tfhk@v0.2.0\n\n    - name: Run tfhk\n      run: tfhk -recursive .\n\n    - name: Check changes\n      id: diff-check\n      run: git diff --exit-code || echo \"changes_detected=true\" \u003e\u003e $GITHUB_OUTPUT\n\n    - name: Commit changes\n      if: steps.diff-check.outputs.changes_detected == 'true'\n      run: |\n        echo steps.diff-check.outputs.changes_detected: ${{ steps.diff-check.outputs.changes_detected }}\n        branch_name=tfhk_$(date +\"%Y%m%d%H%M\")\n        git switch -c ${branch_name}\n        git config --global user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n        git config --global user.name \"github-actions[bot]\"\n        git add .\n        git diff --cached --exit-code || (git commit -m \"auto-remove blocks by tfhk\" \u0026\u0026 git push origin ${branch_name})\n        gh pr create --base main --head ${branch_name} --title \"auto-remove blocks by tfhk\" --body \"\"\n      env:\n        GH_TOKEN: ${{ steps.app-token.outputs.token }}\n```\n\n# References\n\n- https://developer.hashicorp.com/terraform/language/modules/develop/refactoring#removing-moved-blocks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshmokmt%2Ftfhk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshmokmt%2Ftfhk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshmokmt%2Ftfhk/lists"}