{"id":43571614,"url":"https://github.com/tqer39/terraform-github","last_synced_at":"2026-02-03T22:16:39.089Z","repository":{"id":149993490,"uuid":"622001394","full_name":"tqer39/terraform-github","owner":"tqer39","description":"Configure GitHub resources with Terraform.","archived":false,"fork":false,"pushed_at":"2026-01-31T07:18:31.000Z","size":876,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-31T09:46:49.862Z","etag":null,"topics":["github","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","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/tqer39.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":".github/CODEOWNERS","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":"2023-03-31T21:30:19.000Z","updated_at":"2026-01-31T07:18:33.000Z","dependencies_parsed_at":"2023-09-26T18:00:12.332Z","dependency_job_id":"36925b5a-3ba2-4002-8ec9-1add281b5aa9","html_url":"https://github.com/tqer39/terraform-github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tqer39/terraform-github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tqer39%2Fterraform-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tqer39%2Fterraform-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tqer39%2Fterraform-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tqer39%2Fterraform-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tqer39","download_url":"https://codeload.github.com/tqer39/terraform-github/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tqer39%2Fterraform-github/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29059539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T20:13:53.544Z","status":"ssl_error","status_checked_at":"2026-02-03T20:13:40.507Z","response_time":96,"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":["github","terraform"],"created_at":"2026-02-03T22:16:38.802Z","updated_at":"2026-02-03T22:16:39.077Z","avatar_url":"https://github.com/tqer39.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-github\n\n## Overview\n\nThis repository is for deploying repositories to GitHub using Terraform and GitHub Actions.\n\n## Getting Started\n\n### Prerequisites\n\nThis project requires [Homebrew](https://brew.sh/) for macOS or Linux. All other dependencies will be installed automatically.\n\n### Quick Setup\n\n1. Install Homebrew and all required tools:\n\n   ```bash\n   make bootstrap\n   ```\n\n   This will install:\n   - [mise](https://mise.jdx.dev/) - Universal tool version manager\n   - [just](https://github.com/casey/just) - Command runner\n   - [git](https://git-scm.com/) - Version control system\n   - [prek](https://prek.j178.dev/) - Git hooks framework\n   - [aws-vault](https://github.com/99designs/aws-vault) - AWS credential management\n\n2. Restart your terminal or reload your shell (for Homebrew PATH)\n\n3. Setup the development environment:\n\n   ```bash\n   just setup\n   ```\n\n   This will:\n   - Install tools defined in `.tool-versions` via mise (Terraform v1.13.3)\n   - Set up pre-commit hooks using prek\n   - Initialize Terraform\n\n### Verify Installation\n\nCheck that all required tools are installed:\n\n```bash\njust check-tools\n```\n\n### Development with Git Worktree\n\nThis project supports parallel development using git worktree. This allows you to work on multiple branches simultaneously without switching between them.\n\n#### Setup Git Worktree\n\n```bash\njust worktree-setup\n```\n\nThis will guide you through creating a new worktree. Worktrees are created in the parent directory with the pattern: `terraform-github-\u003cbranch-name\u003e`\n\n#### Manual Worktree Management\n\nCreate a new worktree:\n\n```bash\n# For a new branch\ngit worktree add ../terraform-github-feature-name -b feature/feature-name\n\n# For an existing branch\ngit worktree add ../terraform-github-feature-name feature/feature-name\n```\n\nList all worktrees:\n\n```bash\ngit worktree list\n```\n\nRemove a worktree:\n\n```bash\ngit worktree remove ../terraform-github-feature-name\n```\n\n### Available Commands\n\n#### Bootstrap (Makefile)\n\n- `make bootstrap` - Install Homebrew and all required tools\n- `make help` - Show Makefile targets\n\n#### Development Tasks (just)\n\nShow all available tasks:\n\n```bash\njust help\n```\n\nCommon tasks:\n\n- `just setup` - Setup development environment (install tools and initialize)\n- `just check-tools` - Verify all required tools are installed\n- `just worktree-setup` - Interactive git worktree setup\n- `just fmt` - Format all Terraform files\n- `just validate` - Validate Terraform configuration\n- `just lint` - Run all linters (prek)\n- `just init` - Initialize Terraform\n- `just plan` - Run Terraform plan\n- `just apply` - Run Terraform apply (use with caution)\n- `just clean` - Clean Terraform temporary files\n- `just version` - Show tool versions (Terraform, mise, just)\n- `just status` - Show mise-managed tool versions\n- `just install` - Install tools from .tool-versions\n- `just update` - Update mise-managed tools\n\n## Deployment Flow\n\n1. A GitHub Actions workflow is triggered (e.g., when a pull request is merged).\n2. The [`set-matrix`](.github/actions/set-matrix/action.yml) action is executed to create a list of directories for Terraform execution.\n3. The [`setup-terraform`](.github/actions/setup-terraform/action.yml) action is executed to set up Terraform.\n4. The [`terraform-plan`](.github/actions/terraform-plan/action.yml) action is executed to create a Terraform plan.\n5. The [`terraform-apply`](.github/actions/terraform-apply/action.yml) action is executed to apply the Terraform plan.\n\n```mermaid\ngraph TD\n  A[actions checkout] --\u003e B[AWS credential aws-credential]\n  B --\u003e C[Generate GitHub App token]\n  C --\u003e D[Terraform Plan]\n  D --\u003e E[Start Deployment]\n  E --\u003e F{push or workflow_dispatch}\n  F -- Yes --\u003e G[Terraform Apply]\n  F -- No --\u003e H[Skip]\n  G --\u003e I[Finish Deployment]\n  H --\u003e I\n```\n\n## How to use the terraform-import workflow\n\nThis workflow is used to import existing GitHub repositories into Terraform management.\n\n### Overview\n\n- The `terraform-import` workflow allows you to import existing GitHub repositories and branch protection settings into the Terraform state.\n- It is executed manually (`workflow_dispatch`) by specifying the target module name and repository name.\n\n### Flow\n\n```mermaid\ngraph TD\n  A[Select Import workflow in Actions tab] --\u003e B[Enter module and repo then run]\n  B --\u003e C[Checkout repository]\n  C --\u003e D[Configure AWS credentials]\n  D --\u003e E[Initialize Terraform]\n  E --\u003e F[Import repository info to state]\n  F --\u003e G[Done]\n```\n\n### Parameters\n\n- `module`: Terraform module name (e.g., `local-workspace-provisioning`, `terraform-aws`, `boilerplate-saas`, etc.)\n- `repo`: GitHub repository name (e.g., `local-workspace-provisioning`, `terraform-aws`, `boilerplate-saas`, etc.)\n\n### Usage\n\n1. Go to the Actions tab in GitHub and select the `Terraform Import` workflow.\n2. Click the `Run workflow` button, enter the `module` and `repo` values, and start the workflow.\n    - Example: `module` = `local-workspace-provisioning`, `repo` = `local-workspace-provisioning`\n    - Example: `module` = `terraform-aws`, `repo` = `terraform-aws`\n3. When the workflow completes, the specified repository information will be imported into the Terraform state.\n\n### Notes\n\n- For `module`, specify the module name under `terraform/src/repository/`.\n- For `repo`, specify the repository name on GitHub.\n- Make sure that `secrets.TERRAFORM_GITHUB_TOKEN` is set as required.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftqer39%2Fterraform-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftqer39%2Fterraform-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftqer39%2Fterraform-github/lists"}