Skip to content

Commit 704e621

Browse files
fix: disable secret scanning by default (#60)
* feat: add module for internal repo * feat: add internal repositories to repository_set * terraform-docs: automated action * feat: set a default value of {} for internal_repositories * terraform-docs: automated action * fix: disable secret scanning by default as it requires exisitng ghas license * terraform-docs: automated action --------- Signed-off-by: Vedant Thapa <43611693+vedantthapa@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent d008758 commit 704e621

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

modules/internal_repository/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ No resources.
3636
| <a name="input_dependabot_security_updates"></a> [dependabot\_security\_updates](#input\_dependabot\_security\_updates) | Enables dependabot security updates. Only works when `has_vulnerability_alerts` is set because that is required to enable dependabot for the repository. | `bool` | `true` | no |
3737
| <a name="input_description"></a> [description](#input\_description) | The description to give to the repository. Defaults to `""` | `string` | `""` | no |
3838
| <a name="input_environments"></a> [environments](#input\_environments) | Environments to create for the repository. | <pre>map(object({<br/> wait_timer = optional(number)<br/> can_admins_bypass = optional(bool)<br/> prevent_self_review = optional(bool)<br/> action_secrets = optional(map(string))<br/> reviewers = optional(object({<br/> teams = optional(list(string))<br/> users = optional(list(string))<br/> }))<br/> deployment_branch_policy = optional(object({<br/> protected_branches = bool<br/> custom_branch_policies = bool<br/> branch_patterns = list(string)<br/> }))<br/> }))</pre> | `{}` | no |
39+
| <a name="input_has_ghas_license"></a> [has\_ghas\_license](#input\_has\_ghas\_license) | If the organization owning the repository has a GitHub Advanced Security license or not. Defaults to false. | `bool` | `false` | no |
3940
| <a name="input_homepage"></a> [homepage](#input\_homepage) | The homepage for the repository | `string` | `""` | no |
4041
| <a name="input_license_template"></a> [license\_template](#input\_license\_template) | The (Optional) license template to apply to the repository | `string` | `null` | no |
4142
| <a name="input_merge_commit_message"></a> [merge\_commit\_message](#input\_merge\_commit\_message) | (Optional) Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if allow\_merge\_commit is `true`. | `string` | `"PR_TITLE"` | no |

modules/internal_repository/repository.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
locals {
2+
enable_secret_scanning = var.has_ghas_license
3+
}
4+
15
module "repository_base" {
26
source = "../repository_base"
37

@@ -29,8 +33,8 @@ module "repository_base" {
2933
requires_web_commit_signing = var.requires_web_commit_signing
3034
pages = var.pages
3135

32-
secret_scanning = true
33-
secret_scanning_on_push = true
36+
secret_scanning = local.enable_secret_scanning
37+
secret_scanning_on_push = local.enable_secret_scanning
3438
has_vulnerability_alerts = true
3539
advance_security = var.advance_security
3640
dependabot_security_updates = var.dependabot_security_updates

modules/internal_repository/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ variable "advance_security" {
7373
default = true
7474
}
7575

76+
variable "has_ghas_license" {
77+
description = "If the organization owning the repository has a GitHub Advanced Security license or not. Defaults to false."
78+
type = bool
79+
default = false
80+
}
81+
7682
variable "action_secrets" {
7783
description = "An (Optional) map of GitHub Actions secrets to create for this repository. The key is the name of the secret and the value is the encrypted value."
7884
type = map(string)

0 commit comments

Comments
 (0)