https://github.com/plus3it/terraform-github-repo
https://github.com/plus3it/terraform-github-repo
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/plus3it/terraform-github-repo
- Owner: plus3it
- License: apache-2.0
- Created: 2019-06-13T20:15:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-06-30T04:28:14.000Z (11 months ago)
- Last Synced: 2025-06-30T05:27:34.670Z (11 months ago)
- Language: HCL
- Homepage:
- Size: 331 KB
- Stars: 3
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## terraform-github-repo
A terraform module to create an organization repository and
configure team access as well as branch protections.
Note: this will only create an organizational repository
## Testing
At the moment, testing is manual:
```
# Replace "xxx" with an your github access token, then execute the integration tests.
export GITHUB_TOKEN=xxx
make terraform/pytest PYTEST_ARGS="-v --nomock"
```
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.14 |
| [github](#requirement\_github) | >= 4.0 |
## Providers
| Name | Version |
|------|---------|
| [github](#provider\_github) | >= 4.0 |
## Resources
| Name | Type |
|------|------|
| github_team.teams | data source |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [name](#input\_name) | Name of the repository | `string` | n/a | yes |
| [allow\_merge\_commit](#input\_allow\_merge\_commit) | Whether to allow merge commits | `bool` | `false` | no |
| [allow\_rebase\_merge](#input\_allow\_rebase\_merge) | Whether to allow rebase merging | `bool` | `true` | no |
| [allow\_squash\_merge](#input\_allow\_squash\_merge) | Whether to allow squash merging | `bool` | `false` | no |
| [archive\_on\_destroy](#input\_archive\_on\_destroy) | Whether to archive on destroy instead of delete | `bool` | `false` | no |
| [auto\_init](#input\_auto\_init) | Automatically initialize the repository upon creation | `bool` | `true` | no |
| [branch\_protection](#input\_branch\_protection) | Branch protection configuration |
object({
enforce_admins = optional(bool)
push_restrictions = optional(list(string))
require_signed_commits = optional(bool)
required_status_checks = optional(object({
strict = optional(bool)
contexts = list(string)
}))
required_pull_request_reviews = optional(object({
dismiss_stale_reviews = optional(bool)
dismissal_restrictions = optional(list(string))
require_code_owner_reviews = optional(bool)
required_approving_review_count = number
}))
}) | `null` | no |
| [delete\_branch\_on\_merge](#input\_delete\_branch\_on\_merge) | Automatically delete head branch after a pull request is merged | `bool` | `true` | no |
| [description](#input\_description) | Description of the repository | `string` | `null` | no |
| [gitignore\_template](#input\_gitignore\_template) | Gitignore template to include in the repository | `string` | `null` | no |
| [has\_issues](#input\_has\_issues) | Enable the GitHub Issues features on the repository | `bool` | `true` | no |
| [has\_projects](#input\_has\_projects) | Enable the GitHub Projects features on the repository | `bool` | `false` | no |
| [has\_wiki](#input\_has\_wiki) | Enable the GitHub Wiki features on the repository | `bool` | `false` | no |
| [homepage\_url](#input\_homepage\_url) | URL of a page describing the project | `string` | `null` | no |
| [is\_template](#input\_is\_template) | Configure this repository as a template repository | `bool` | `false` | no |
| [license\_template](#input\_license\_template) | Type of license to include in the repository | `string` | `null` | no |
| [teams](#input\_teams) | List of teams to grant permissions to the repository | list(object({
name = string
permission = optional(string)
})) | `[]` | no |
| [template](#input\_template) | Template repository used to create this repository | object({
owner = string
repository = string
}) | `null` | no |
| [topics](#input\_topics) | List of topics to apply to the repository | `list(string)` | `[]` | no |
| [visibility](#input\_visibility) | Visibility of the repository. One of: `public`, `private`, or `internal` | `string` | `"public"` | no |
| [vulnerability\_alerts](#input\_vulnerability\_alerts) | Whether to enable security alerts for dependencies | `bool` | `true` | no |
## Outputs
| Name | Description |
|------|-------------|
| [repo](#output\_repo) | Object with all repo attributes |