Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
91d0885
fmted and wip of ruleset support. Testing out setting bypasses
TylerMizuyabu Mar 11, 2024
0e403a2
typo
TylerMizuyabu Mar 11, 2024
f8045f8
Bad resource name
TylerMizuyabu Mar 11, 2024
c137dba
bad var reference
TylerMizuyabu Mar 11, 2024
832fa42
have to merge all the maps
TylerMizuyabu Mar 11, 2024
43f4ba7
coalesece disable
TylerMizuyabu Mar 11, 2024
3c8e824
Removed github app datasource
TylerMizuyabu Mar 11, 2024
05ef245
changed list(string) to list(number)
TylerMizuyabu Mar 11, 2024
dac45ed
I need to get my linting working
TylerMizuyabu Mar 11, 2024
1be1393
moved conditional
TylerMizuyabu Mar 11, 2024
2b21c6a
I don't know how that happened
TylerMizuyabu Mar 11, 2024
8522c03
forgot to access id from datasource
TylerMizuyabu Mar 11, 2024
6f11801
allow for bypass mode to be changed
TylerMizuyabu Mar 11, 2024
2c164ac
come on tyler
TylerMizuyabu Mar 11, 2024
56e53cb
coallesce always bypass to false
TylerMizuyabu Mar 11, 2024
9b87141
first iteration of allowing rule definition
TylerMizuyabu Mar 11, 2024
c14cbd4
testing removal of problem rules
TylerMizuyabu Mar 11, 2024
08ca2b3
changed toset and compact to use a try instead of compact
TylerMizuyabu Mar 11, 2024
f3bfa71
focusing on branch_name_pattern
TylerMizuyabu Mar 11, 2024
e86bf35
removed caolesce
TylerMizuyabu Mar 11, 2024
e2a8b8b
setting to null
TylerMizuyabu Mar 11, 2024
70cdfc4
using ternary
TylerMizuyabu Mar 11, 2024
67c1a12
changed rest to ternary
TylerMizuyabu Mar 11, 2024
7ec4124
typo
TylerMizuyabu Mar 11, 2024
070d6ee
Added the problem rules back in
TylerMizuyabu Mar 11, 2024
c53a0c9
setting default for context name
TylerMizuyabu Mar 11, 2024
2769390
upgraded version
TylerMizuyabu Mar 12, 2024
7d5c3bf
moved things around
TylerMizuyabu Mar 12, 2024
e53f3eb
default value isn't correct
TylerMizuyabu Mar 12, 2024
e271d33
default value should be an empty list
TylerMizuyabu Mar 12, 2024
d40df08
does it just hate this property?
TylerMizuyabu Mar 12, 2024
b369252
removed required_status_chekcs
TylerMizuyabu Mar 12, 2024
485bf5b
fixing conditional
TylerMizuyabu Mar 12, 2024
00f8a11
property is bugged
TylerMizuyabu Mar 12, 2024
6862a02
if this failes I don't understand why
TylerMizuyabu Mar 12, 2024
462f504
so why does this fail?
TylerMizuyabu Mar 12, 2024
ebc48b5
change conditional?
TylerMizuyabu Mar 12, 2024
69a8835
trying to use compact
TylerMizuyabu Mar 12, 2024
baf53d5
what am I doing?
TylerMizuyabu Mar 12, 2024
ddf3f48
please let this work
TylerMizuyabu Mar 12, 2024
3a8a884
why am I like this?
TylerMizuyabu Mar 12, 2024
38f2db1
added conditions
TylerMizuyabu Mar 12, 2024
51d2052
I can't keep doing this
TylerMizuyabu Mar 12, 2024
fde2e1a
added tagname pattern and ability to choose target
TylerMizuyabu Mar 12, 2024
f553f3c
allow customizing enforcement
TylerMizuyabu Mar 12, 2024
aae77ea
I have to stop forgetting value
TylerMizuyabu Mar 12, 2024
8faed2c
first version of repository rulesets
TylerMizuyabu Mar 12, 2024
010ff47
updating versions
TylerMizuyabu Mar 12, 2024
c300f29
fixed repo ruleset
TylerMizuyabu Mar 14, 2024
48fb051
fixing null issue
TylerMizuyabu Mar 14, 2024
c15253c
added some ruleset tempaltes
TylerMizuyabu Mar 14, 2024
3a67a85
you have to include repository_name
TylerMizuyabu Mar 14, 2024
6adaa35
removed coalesce
TylerMizuyabu Mar 14, 2024
aadd0e6
fixed count statement
TylerMizuyabu Mar 14, 2024
9825910
added coalesce back in
TylerMizuyabu Mar 14, 2024
0da9793
bad references
TylerMizuyabu Mar 14, 2024
f13aa9b
trying something
TylerMizuyabu Mar 14, 2024
f941a12
updated repo ruleset
TylerMizuyabu Mar 14, 2024
22a535f
removed bad vars
TylerMizuyabu Mar 14, 2024
53baaec
flatten isntead of concate
TylerMizuyabu Mar 14, 2024
8e340da
moved a rule setting
TylerMizuyabu Mar 14, 2024
0f2d9b7
terraform-docs: automated action
github-actions[bot] Mar 14, 2024
0e8bf97
Update modules/repository_set/repositories.tf
TylerMizuyabu Mar 14, 2024
76febc3
reduced tf version requirement to 1.3
TylerMizuyabu Mar 14, 2024
90b4051
terraform-docs: automated action
github-actions[bot] Mar 14, 2024
7a06925
created shared ruleset module
TylerMizuyabu Mar 14, 2024
1c10ea5
terraform-docs: automated action
github-actions[bot] Mar 14, 2024
7889f80
typo
TylerMizuyabu Mar 14, 2024
96353c6
bad copilot
TylerMizuyabu Mar 14, 2024
80bddd3
I hate you copilot
TylerMizuyabu Mar 14, 2024
5a810f5
logic error
TylerMizuyabu Mar 14, 2024
e838480
what am i doing
TylerMizuyabu Mar 14, 2024
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
43 changes: 27 additions & 16 deletions modules/organization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,51 @@
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_github"></a> [github](#requirement\_github) | 5.42.0 |
| <a name="requirement_github"></a> [github](#requirement\_github) | 6.1.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_github"></a> [github](#provider\_github) | 5.42.0 |
| <a name="provider_github"></a> [github](#provider\_github) | 6.1.0 |

## Modules

No modules.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_base_default_branch_protection"></a> [base\_default\_branch\_protection](#module\_base\_default\_branch\_protection) | ../ruleset | n/a |
| <a name="module_dismiss_stale_reviews"></a> [dismiss\_stale\_reviews](#module\_dismiss\_stale\_reviews) | ../ruleset | n/a |
| <a name="module_minimum_approvals"></a> [minimum\_approvals](#module\_minimum\_approvals) | ../ruleset | n/a |
| <a name="module_require_signatures"></a> [require\_signatures](#module\_require\_signatures) | ../ruleset | n/a |
| <a name="module_ruleset"></a> [ruleset](#module\_ruleset) | ../ruleset | n/a |

## Resources

| Name | Type |
|------|------|
| [github_actions_organization_secret.action_secret](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/actions_organization_secret) | resource |
| [github_codespaces_organization_secret.codespace_secret](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/codespaces_organization_secret) | resource |
| [github_dependabot_organization_secret.dependabot_secret](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/dependabot_organization_secret) | resource |
| [github_membership.membership_for_user](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/membership) | resource |
| [github_organization_block.blocked_user](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/organization_block) | resource |
| [github_organization_custom_role.community_manager_role](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/organization_custom_role) | resource |
| [github_organization_custom_role.contractor_role](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/organization_custom_role) | resource |
| [github_organization_custom_role.custom_repository_role](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/organization_custom_role) | resource |
| [github_organization_custom_role.security_engineer_role](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/organization_custom_role) | resource |
| [github_organization_settings.organization_settings](https://registry.terraform.io/providers/integrations/github/5.42.0/docs/resources/organization_settings) | resource |
| [github_actions_organization_secret.action_secret](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/actions_organization_secret) | resource |
| [github_codespaces_organization_secret.codespace_secret](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/codespaces_organization_secret) | resource |
| [github_dependabot_organization_secret.dependabot_secret](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/dependabot_organization_secret) | resource |
| [github_membership.membership_for_user](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/membership) | resource |
| [github_organization_block.blocked_user](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/organization_block) | resource |
| [github_organization_custom_role.community_manager_role](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/organization_custom_role) | resource |
| [github_organization_custom_role.contractor_role](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/organization_custom_role) | resource |
| [github_organization_custom_role.custom_repository_role](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/organization_custom_role) | resource |
| [github_organization_custom_role.security_engineer_role](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/organization_custom_role) | resource |
| [github_organization_settings.organization_settings](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/resources/organization_settings) | resource |
| [github_organization_custom_role.branch_ruleset_bypasser](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/data-sources/organization_custom_role) | data source |
| [github_team.branch_ruleset_bypasser](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/data-sources/team) | data source |
| [github_user.branch_ruleset_bypasser](https://registry.terraform.io/providers/integrations/github/6.1.0/docs/data-sources/user) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_actions_secrets"></a> [actions\_secrets](#input\_actions\_secrets) | A map of organization-level GitHub Actions secrets to create. The key is the name of the secret and the value is an object describing how to create the secret. | <pre>map(object({<br> encrypted_value = string<br> visibility = string<br> }))</pre> | `{}` | no |
| <a name="input_codespaces_secrets"></a> [codespaces\_secrets](#input\_codespaces\_secrets) | A map of organization-level GitHub Codespaces secrets to create. The key is the name of the secret and the value is an object describing how to create the secret. | <pre>map(object({<br> encrypted_value = string<br> visibility = string<br> }))</pre> | `{}` | no |
| <a name="input_actions_secrets"></a> [actions\_secrets](#input\_actions\_secrets) | A map of organization-level GitHub Actions secrets to create. The key is the name of the secret and the value is an object describing how to create the secret. | <pre>map(object({<br> encrypted_value = string<br> visibility = string<br> }))</pre> | `{}` | no |
| <a name="input_codespaces_secrets"></a> [codespaces\_secrets](#input\_codespaces\_secrets) | A map of organization-level GitHub Codespaces secrets to create. The key is the name of the secret and the value is an object describing how to create the secret. | <pre>map(object({<br> encrypted_value = string<br> visibility = string<br> }))</pre> | `{}` | no |
| <a name="input_custom_repository_roles"></a> [custom\_repository\_roles](#input\_custom\_repository\_roles) | A map of custom repository roles to create. The key is the name of the role and the value is the role configurations. | <pre>map(object({<br> description = string<br> base_role = string<br> permissions = list(string)<br> }))</pre> | n/a | yes |
| <a name="input_dependabot_secrets"></a> [dependabot\_secrets](#input\_dependabot\_secrets) | A map of organization-level Dependabot secrets to create. The key is the name of the secret and the value is an object describing how to create the secret. | <pre>map(object({<br> encrypted_value = string<br> visibility = string<br> }))</pre> | `{}` | no |
| <a name="input_default_branch_protection_rulesets"></a> [default\_branch\_protection\_rulesets](#input\_default\_branch\_protection\_rulesets) | n/a | <pre>object({<br> base_protection = optional(object({<br> enforcement = string<br> }))<br> minimum_approvals = optional(object({<br> enforcement = string<br> approvals_required = number<br> }))<br> dismiss_stale_reviews = optional(object({<br> enforcement = string<br> }))<br> require_signatures = optional(object({<br> enforcement = string<br> }))<br> bypass_actors = optional(object({<br> repository_roles = optional(list(object({<br> role = string<br> always_bypass = optional(bool)<br> })))<br> teams = optional(list(object({<br> team = string<br> always_bypass = optional(bool)<br> })))<br> integrations = optional(list(object({<br> installation_id = number<br> always_bypass = optional(bool)<br> })))<br> organization_admins = optional(list(object({<br> user = string<br> always_bypass = optional(bool)<br> })))<br> }))<br> })</pre> | `{}` | no |
| <a name="input_dependabot_secrets"></a> [dependabot\_secrets](#input\_dependabot\_secrets) | A map of organization-level Dependabot secrets to create. The key is the name of the secret and the value is an object describing how to create the secret. | <pre>map(object({<br> encrypted_value = string<br> visibility = string<br> }))</pre> | `{}` | no |
| <a name="input_enable_community_manager_role"></a> [enable\_community\_manager\_role](#input\_enable\_community\_manager\_role) | If `true` will create a custom repository role for community managers. Defaults to `false`. If `true` the maximum number of `custom_repository_roles` that can be defined will be reduced by one. | `bool` | `false` | no |
| <a name="input_enable_contractor_role"></a> [enable\_contractor\_role](#input\_enable\_contractor\_role) | If `true` will create a custom repository role for contractors. Defaults to `false`. If `true` the maximum number of `custom_repository_roles` that can be defined will be reduced by one. | `bool` | `false` | no |
| <a name="input_enable_security_engineer_role"></a> [enable\_security\_engineer\_role](#input\_enable\_security\_engineer\_role) | If `true` will create a custom repository role for security engineers. Defaults to `false`. If `true` the maximum number of `custom_repository_roles` that can be defined will be reduced by one. | `bool` | `false` | no |
Expand All @@ -57,6 +67,7 @@ No modules.
| <a name="input_github_organization_pages_settings"></a> [github\_organization\_pages\_settings](#input\_github\_organization\_pages\_settings) | Settings for organization page creation. The default setting does not allow members to create public and private pages. | <pre>object({<br> members_can_create_public = bool,<br> members_can_create_private = bool<br> })</pre> | <pre>{<br> "members_can_create_private": false,<br> "members_can_create_public": false<br>}</pre> | no |
| <a name="input_github_organization_repository_settings"></a> [github\_organization\_repository\_settings](#input\_github\_organization\_repository\_settings) | Settings for organization repository creation. The default setting allows members to create internal and private repositories but not public. | <pre>object({<br> members_can_create_public = bool,<br> members_can_create_internal = bool,<br> members_can_create_private = bool<br> })</pre> | <pre>{<br> "members_can_create_internal": true,<br> "members_can_create_private": true,<br> "members_can_create_public": false<br>}</pre> | no |
| <a name="input_github_organization_requires_web_commit_signing"></a> [github\_organization\_requires\_web\_commit\_signing](#input\_github\_organization\_requires\_web\_commit\_signing) | If set commit signatures are required for commits to the organization. Defaults to `false`. | `bool` | `false` | no |
| <a name="input_rulesets"></a> [rulesets](#input\_rulesets) | n/a | <pre>map(object({<br> bypass_actors = optional(object({<br> repository_roles = optional(list(object({<br> role = string<br> always_bypass = optional(bool)<br> })))<br> teams = optional(list(object({<br> team = string<br> always_bypass = optional(bool)<br> })))<br> integrations = optional(list(object({<br> installation_id = number<br> always_bypass = optional(bool)<br> })))<br> organization_admins = optional(list(object({<br> user = string<br> always_bypass = optional(bool)<br> })))<br> }))<br> conditions = optional(object({<br> ref_name = object({<br> include = list(string)<br> exclude = list(string)<br> })<br> repository_name = object({<br> include = list(string)<br> exclude = list(string)<br> })<br> }))<br> rules = object({<br> branch_name_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> tag_name_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> commit_author_email_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> commit_message_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> committer_email_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> creation = optional(bool)<br> deletion = optional(bool)<br> update = optional(bool)<br> non_fast_forward = optional(bool)<br> required_linear_history = optional(bool)<br> required_signatures = optional(bool)<br> pull_request = optional(object({<br> dismiss_stale_reviews_on_push = optional(bool)<br> require_code_owner_review = optional(bool)<br> require_last_push_approval = optional(bool)<br> required_approving_review_count = optional(number)<br> required_review_thread_resolution = optional(bool)<br> }))<br> required_status_checks = optional(object({<br> required_check = list(object({<br> context = string<br> integration_id = optional(number)<br> }))<br> strict_required_status_check_policy = optional(bool)<br> }))<br> required_workflows = optional(object({<br> required_workflows = list(object({<br> repository_id = number<br> path = string<br> ref = optional(string)<br> }))<br> }))<br> })<br> target = string<br> enforcement = string<br> }))</pre> | `{}` | no |

## Outputs

Expand Down
Loading