Resource that allows to declare branch protection rules for repository.
| Name | Version |
|---|---|
| terraform | >= 0.13 |
| github | < 5.0 |
| Name | Version |
|---|---|
| github | < 5.0 |
| Name | Type |
|---|---|
| github_repository.default | resource |
| github_team_repository.admin | resource |
| github_team_repository.pull | resource |
| github_team_repository.push | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| repository_name | Name of the repository that is point of module | string |
n/a | yes |
| repository_description | Description that will be visible on board of projects inside GitHub | string |
n/a | yes |
| homepage_url | URL of a page describing the project | string |
"" |
no |
| repository_private | Set repository visible outside of organization. (Default: true) | bool |
true |
no |
| archived | Set to true to archive repository. (Default: false) | bool |
false |
no |
| pull_teams | Teams ids that will have read-only access to the repository. | list(string) |
[] |
no |
| push_teams | Teams ids that will have read-write access to the repository. | list(string) |
[] |
no |
| admin_teams | Teams ids that will have admin access over the repository. | list(string) |
[] |
no |
| is_template | If set to true then repository can be used as a template for other repositories | bool |
false |
no |
| template | If passed, then repository will be created from the template. | object({ |
null |
no |
| allow_rebase | Allow developers to modify history of commits. | bool |
false |
no |
| license_template | License template eg: "mit", "mpl-2.0". | string |
null |
no |
| has_issues | Enables GitHub Issues feature | bool |
false |
no |
| has_projects | Enables GitHub Projects feature | bool |
false |
no |
| has_wiki | Enables GitHub Wiki feature | bool |
false |
no |
| vulnerability_alerts | Set to enable security alerts for vulnerable dependencies | bool |
false |
no |
| Name | Description |
|---|---|
| repository_name | n/a |
module "some-repo" {
source = "[email protected]:masterborn/terraform-github-default-repository.git?ref=v1.0.2"
repository_name = "some-repo"
repository_description = "Example repo"
allow_rebase = true
admin_teams = [module.some-team.admins_id]
push_teams = [module.some-team.developers_id]
pull_teams = [module.some-team.visitors_id, module.some-team.testers_id]
}Following pre-commit hooks are provided:
- terraform-fmt to check syntax of terraform
- terraform-docs to recreate README.md according to terraform module properties
- end-of-file-fixer to ensure that each file ends with newline
To install pre-commit check .
pre-commit install