{"id":19586337,"url":"https://github.com/tbobm/terraform-github-environments","last_synced_at":"2026-05-16T01:31:26.671Z","repository":{"id":104231066,"uuid":"434919156","full_name":"tbobm/terraform-github-environments","owner":"tbobm","description":"Manage Github Repository Environments.","archived":false,"fork":false,"pushed_at":"2023-05-20T18:37:20.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-06T15:06:46.036Z","etag":null,"topics":["github","github-provider","iac","terraform","terraform-github-provider","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"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/tbobm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-04T14:11:20.000Z","updated_at":"2021-12-11T00:22:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"28b89bba-7169-4a16-9d5e-22841129b080","html_url":"https://github.com/tbobm/terraform-github-environments","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tbobm/terraform-github-environments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbobm%2Fterraform-github-environments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbobm%2Fterraform-github-environments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbobm%2Fterraform-github-environments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbobm%2Fterraform-github-environments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tbobm","download_url":"https://codeload.github.com/tbobm/terraform-github-environments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbobm%2Fterraform-github-environments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33087028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","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":["github","github-provider","iac","terraform","terraform-github-provider","terraform-module"],"created_at":"2024-11-11T07:59:27.034Z","updated_at":"2026-05-16T01:31:26.666Z","avatar_url":"https://github.com/tbobm.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-github-environments\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/terraform-github-environments)\n[![terraform-github-environments](https://github.com/tbobm/terraform-github-environments/workflows/terraform-github-environments/badge.svg)](https://github.com/tbobm/terraform-github-environments/actions?query=workflow%3Aterraform-github-environments)\n\nTerraform module to create Github Environments for Github Actions.\n\n## Usage\n\n_Note: Github Actions Environments are available for Public Repositories and\nGithub Enterprise Cloud users. ([doc][gh-env-doc])_\n\n[gh-env-doc]: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment\n\n### Github Authentication\n\nYou will need to authenticate against Github using an OAuth Token or Personal Access Token.\nSee [Github Provider#Authentication][tf-gh-auth] for more informations.\n\nThis can be done by setting the `token` argument of the `github` provider or by exporting\nyour Token to the `GITHUB_TOKEN` environment variable.\n\n_Provider configuration:_\n```hcl\nprovider \"github\" {\n  token = var.token # or `GITHUB_TOKEN`\n}\n```\n\n_Environment variable configuration:_\n```bash\nexport GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\n[tf-gh-auth]: https://registry.terraform.io/providers/integrations/github/latest/docs#authentication\n\n### Creating the Environments\n\nThis module takes a `map` of objects for each Environement to configure.\n\n```hcl\nmodule \"env\" {\n  source = \"../\"\n\n  repository = \"tbobm/terraform-github-secrets\"\n\n  environments = {\n    \"stable\" = {}\n\n    \"protected\" = {\n      deployment_branch_policy = {\n        protected_branches     = true\n        custom_branch_policies = false\n      }\n    }\n  }\n}\n```\n\nHere we defined two environemnts:\n- the `stable` environment\n- the `protected` environment with protected branches enabled\n\n## Doc generation\n\nCode formatting and documentation for variables and outputs is generated using\n[pre-commit-terraform\nhooks](https://github.com/antonbabenko/pre-commit-terraform) which uses\n[terraform-docs](https://github.com/segmentio/terraform-docs).\n\nFollow [these\ninstructions](https://github.com/antonbabenko/pre-commit-terraform#how-to-install)\nto install pre-commit locally.\n\nAnd install `terraform-docs` with `go get github.com/segmentio/terraform-docs`\nor `brew install terraform-docs`.\n\n## Contributing\n\nReport issues/questions/feature requests on in the\n[issues](https://github.com/tbobm/terraform-github-environments/issues/new)\nsection.\n\nFull contributing [guidelines are covered\nhere](https://github.com/tbobm/terraform-github-environments/blob/master/.github/CONTRIBUTING.md).\n\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_github\"\u003e\u003c/a\u003e [github](#requirement\\_github) | ~\u003e 4.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_github\"\u003e\u003c/a\u003e [github](#provider\\_github) | ~\u003e 4.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [github_repository_environment.this](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_environment) | resource |\n| [github_repository.this](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_environments\"\u003e\u003c/a\u003e [environments](#input\\_environments) | A map of environment definitions | `map(any)` | n/a | yes |\n| \u003ca name=\"input_repository\"\u003e\u003c/a\u003e [repository](#input\\_repository) | The full name of the repository in the form org/repo | `string` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_environments\"\u003e\u003c/a\u003e [environments](#output\\_environments) | A map of the created environments |\n| \u003ca name=\"output_repository\"\u003e\u003c/a\u003e [repository](#output\\_repository) | The target github repository informations |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbobm%2Fterraform-github-environments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbobm%2Fterraform-github-environments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbobm%2Fterraform-github-environments/lists"}