From efdf6b44ce4395ca3d6c31a31acf50b45a44ca6b Mon Sep 17 00:00:00 2001 From: Piotr Gaczkowski Date: Mon, 17 Jan 2022 11:38:16 +0000 Subject: [PATCH 1/3] feat: Add base URL for GitHub Enterprise --- modules/github-repository-webhook/README.md | 1 + modules/github-repository-webhook/main.tf | 5 +++-- modules/github-repository-webhook/variables.tf | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/github-repository-webhook/README.md b/modules/github-repository-webhook/README.md index bce417b9..287893f2 100644 --- a/modules/github-repository-webhook/README.md +++ b/modules/github-repository-webhook/README.md @@ -30,6 +30,7 @@ No modules. |------|-------------|------|---------|:--------:| | [atlantis\_allowed\_repo\_names](#input\_atlantis\_allowed\_repo\_names) | List of names of repositories which belong to the owner specified in `github_owner` | `list(string)` | n/a | yes | | [create\_github\_repository\_webhook](#input\_create\_github\_repository\_webhook) | Whether to create Github repository webhook for Atlantis | `bool` | `true` | no | +| [github\_base_url](#input\_github\_base_url) | Github base URL to use when creating webhook (when using GitHub Enterprise) | `string` | `""` | no | | [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | `""` | no | | [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | `""` | no | | [webhook\_secret](#input\_webhook\_secret) | Webhook secret | `string` | `""` | no | diff --git a/modules/github-repository-webhook/main.tf b/modules/github-repository-webhook/main.tf index 2ddbaddf..9af7660c 100644 --- a/modules/github-repository-webhook/main.tf +++ b/modules/github-repository-webhook/main.tf @@ -1,6 +1,7 @@ provider "github" { - token = var.github_token - owner = var.github_owner + base_url = var.github_base_url + token = var.github_token + owner = var.github_owner } resource "github_repository_webhook" "this" { diff --git a/modules/github-repository-webhook/variables.tf b/modules/github-repository-webhook/variables.tf index 709aab58..bb044f7e 100644 --- a/modules/github-repository-webhook/variables.tf +++ b/modules/github-repository-webhook/variables.tf @@ -4,6 +4,12 @@ variable "create_github_repository_webhook" { default = true } +variable "github_base_url" { + description = "Github base URL to use when creating webhook (when using GitHub Enterprise)" + type = string + default = "" +} + variable "github_token" { description = "Github token to use when creating webhook" type = string From 142a72519e1aa83a1ed6f49711dcc35a4bb110c0 Mon Sep 17 00:00:00 2001 From: Piotr Gaczkowski Date: Mon, 17 Jan 2022 11:51:55 +0000 Subject: [PATCH 2/3] fix: Switch the default value to null --- modules/github-repository-webhook/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/github-repository-webhook/variables.tf b/modules/github-repository-webhook/variables.tf index bb044f7e..649ad245 100644 --- a/modules/github-repository-webhook/variables.tf +++ b/modules/github-repository-webhook/variables.tf @@ -7,7 +7,7 @@ variable "create_github_repository_webhook" { variable "github_base_url" { description = "Github base URL to use when creating webhook (when using GitHub Enterprise)" type = string - default = "" + default = null } variable "github_token" { From 0b65204800df6cf056821f3880609b53f93a4776 Mon Sep 17 00:00:00 2001 From: Piotr Gaczkowski Date: Mon, 17 Jan 2022 12:14:37 +0000 Subject: [PATCH 3/3] fix: tf-docs update --- modules/github-repository-webhook/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/github-repository-webhook/README.md b/modules/github-repository-webhook/README.md index 287893f2..5eae4e9c 100644 --- a/modules/github-repository-webhook/README.md +++ b/modules/github-repository-webhook/README.md @@ -30,7 +30,7 @@ No modules. |------|-------------|------|---------|:--------:| | [atlantis\_allowed\_repo\_names](#input\_atlantis\_allowed\_repo\_names) | List of names of repositories which belong to the owner specified in `github_owner` | `list(string)` | n/a | yes | | [create\_github\_repository\_webhook](#input\_create\_github\_repository\_webhook) | Whether to create Github repository webhook for Atlantis | `bool` | `true` | no | -| [github\_base_url](#input\_github\_base_url) | Github base URL to use when creating webhook (when using GitHub Enterprise) | `string` | `""` | no | +| [github\_base\_url](#input\_github\_base\_url) | Github base URL to use when creating webhook (when using GitHub Enterprise) | `string` | `null` | no | | [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | `""` | no | | [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | `""` | no | | [webhook\_secret](#input\_webhook\_secret) | Webhook secret | `string` | `""` | no |