Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLT-816 - Add support to set pull request by passers #54

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ module "example_repo" {
| <a name="input_attributes"></a> [attributes](#input\_attributes) | Additional attributes (e.g. `policy` or `role`) | `list(string)` | `[]` | no |
| <a name="input_auto_init"></a> [auto\_init](#input\_auto\_init) | Meaningful only during create; set to `true` to produce an initial commit in the repository. | `bool` | `true` | no |
| <a name="input_bot_secrets"></a> [bot\_secrets](#input\_bot\_secrets) | Repository dependabot secrets. | <pre>map(object({<br> encrypted_value = optional(string)<br> plaintext_value = optional(string)<br> }))</pre> | `{}` | no |
| <a name="input_branch_protection"></a> [branch\_protection](#input\_branch\_protection) | Branch protection settings. Use to set protection rules for branches different to default branch. | <pre>map(object({<br> enforce_admins = optional(bool, true)<br> allows_deletions = optional(bool, false)<br> allows_force_pushes = optional(bool, false)<br> require_signed_commits = optional(bool, true)<br> required_linear_history = optional(bool, false)<br> require_conversation_resolution = optional(bool, false)<br> push_restrictions = optional(list(string), [])<br> required_status_enabled = optional(bool, true)<br> required_status_checks = optional(object({<br> strict = optional(bool, true)<br> contexts = optional(list(string), [])<br> }), {})<br> required_pull_request_enabled = optional(bool, true)<br> required_pull_request_reviews = optional(object({<br> dismiss_stale_reviews = optional(bool, true)<br> restrict_dismissals = optional(bool, false)<br> dismissal_restrictions = optional(list(string), [])<br> require_code_owner_reviews = optional(bool, true)<br> required_approving_review_count = optional(number, 1)<br> }), {})<br> }))</pre> | `{}` | no |
| <a name="input_branch_protection"></a> [branch\_protection](#input\_branch\_protection) | Branch protection settings. Use to set protection rules for branches different to default branch. | <pre>map(object({<br> enforce_admins = optional(bool, true)<br> allows_deletions = optional(bool, false)<br> allows_force_pushes = optional(bool, false)<br> require_signed_commits = optional(bool, true)<br> required_linear_history = optional(bool, false)<br> require_conversation_resolution = optional(bool, false)<br> push_restrictions = optional(list(string), [])<br> required_status_enabled = optional(bool, true)<br> required_status_checks = optional(object({<br> strict = optional(bool, true)<br> contexts = optional(list(string), [])<br> }), {})<br> required_pull_request_enabled = optional(bool, true)<br> required_pull_request_reviews = optional(object({<br> dismiss_stale_reviews = optional(bool, true)<br> restrict_dismissals = optional(bool, false)<br> dismissal_restrictions = optional(list(string), [])<br> pull_request_bypassers = optional(list(string), [])<br> require_code_owner_reviews = optional(bool, true)<br> required_approving_review_count = optional(number, 1)<br> }), {})<br> }))</pre> | `{}` | no |
| <a name="input_collaborators"></a> [collaborators](#input\_collaborators) | Map of users with permissions. | `map(string)` | `{}` | no |
| <a name="input_default_branch"></a> [default\_branch](#input\_default\_branch) | The repository's default branch. The branch should exist prio to apply. | `string` | `"main"` | no |
| <a name="input_default_branch_protection"></a> [default\_branch\_protection](#input\_default\_branch\_protection) | Default branch protection settings. | <pre>object({<br> enforce_admins = optional(bool, true)<br> allows_deletions = optional(bool, false)<br> allows_force_pushes = optional(bool, false)<br> require_signed_commits = optional(bool, true)<br> required_linear_history = optional(bool, false)<br> require_conversation_resolution = optional(bool, false)<br> push_restrictions = optional(list(string), [])<br> required_status_enabled = optional(bool, true)<br> required_status_checks = optional(object({<br> strict = optional(bool, true)<br> contexts = optional(list(string), [])<br> }), {})<br> required_pull_request_enabled = optional(bool, true)<br> required_pull_request_reviews = optional(object({<br> dismiss_stale_reviews = optional(bool, true)<br> restrict_dismissals = optional(bool, false)<br> dismissal_restrictions = optional(list(string), [])<br> require_code_owner_reviews = optional(bool, true)<br> required_approving_review_count = optional(number, 1)<br> }), {})<br> })</pre> | `{}` | no |
| <a name="input_default_branch_protection"></a> [default\_branch\_protection](#input\_default\_branch\_protection) | Default branch protection settings. | <pre>object({<br> enforce_admins = optional(bool, true)<br> allows_deletions = optional(bool, false)<br> allows_force_pushes = optional(bool, false)<br> require_signed_commits = optional(bool, true)<br> required_linear_history = optional(bool, false)<br> require_conversation_resolution = optional(bool, false)<br> push_restrictions = optional(list(string), [])<br> required_status_enabled = optional(bool, true)<br> required_status_checks = optional(object({<br> strict = optional(bool, true)<br> contexts = optional(list(string), [])<br> }), {})<br> required_pull_request_enabled = optional(bool, true)<br> required_pull_request_reviews = optional(object({<br> dismiss_stale_reviews = optional(bool, true)<br> restrict_dismissals = optional(bool, false)<br> dismissal_restrictions = optional(list(string), [])<br> pull_request_bypassers = optional(list(string), [])<br> require_code_owner_reviews = optional(bool, true)<br> required_approving_review_count = optional(number, 1)<br> }), {})<br> })</pre> | `{}` | no |
| <a name="input_default_branch_protection_enabled"></a> [default\_branch\_protection\_enabled](#input\_default\_branch\_protection\_enabled) | Set to `false` if you want to disable branch protection for default branch | `bool` | `true` | no |
| <a name="input_delete_branch_on_merge"></a> [delete\_branch\_on\_merge](#input\_delete\_branch\_on\_merge) | Automatically delete head branch after a pull request is merged. | `bool` | `true` | no |
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between `name`, `namespace`, `tenant`, etc. | `string` | `"-"` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ resource "github_branch_protection" "this" {
dismissal_restrictions = reviews.value["dismissal_restrictions"]
require_code_owner_reviews = reviews.value["require_code_owner_reviews"]
required_approving_review_count = reviews.value["required_approving_review_count"]
pull_request_bypassers = reviews.value["pull_request_bypassers"]
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ variable "default_branch_protection" {
dismiss_stale_reviews = optional(bool, true)
restrict_dismissals = optional(bool, false)
dismissal_restrictions = optional(list(string), [])
pull_request_bypassers = optional(list(string), [])
require_code_owner_reviews = optional(bool, true)
required_approving_review_count = optional(number, 1)
}), {})
Expand Down Expand Up @@ -291,6 +292,7 @@ variable "branch_protection" {
dismiss_stale_reviews = optional(bool, true)
restrict_dismissals = optional(bool, false)
dismissal_restrictions = optional(list(string), [])
pull_request_bypassers = optional(list(string), [])
require_code_owner_reviews = optional(bool, true)
required_approving_review_count = optional(number, 1)
}), {})
Expand Down