Skip to content

Commit ad155d1

Browse files
committed
Added github provider
1 parent bc498d3 commit ad155d1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/provider-github.tf

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ variable "ssm_github_app_private_key" {
4343
}
4444

4545
locals {
46-
github_token = local.create_github_webhook ? (
47-
var.github_app_enabled ? null : coalesce(var.github_token_override, try(data.aws_ssm_parameter.github_api_key[0].value, null))
48-
) : ""
46+
github_token = var.github_app_enabled ? null : coalesce(var.github_token_override, try(data.aws_ssm_parameter.github_api_key[0].value, null))
4947
}
5048

5149
# SSM Parameter for PAT Authentication
5250
data "aws_ssm_parameter" "github_api_key" {
53-
count = local.create_github_webhook && !var.github_app_enabled ? 1 : 0
51+
count = !var.github_app_enabled ? 1 : 0
5452
name = var.ssm_github_api_key
5553
with_decryption = true
5654
}
@@ -64,9 +62,9 @@ data "aws_ssm_parameter" "github_app_private_key" {
6462

6563
# We will only need the github provider if we are creating the GitHub webhook with github_repository_webhook.
6664
provider "github" {
67-
base_url = local.create_github_webhook ? var.github_base_url : null
68-
owner = local.create_github_webhook ? var.github_organization : null
69-
token = local.create_github_webhook ? local.github_token : null
65+
base_url = var.github_base_url
66+
owner = var.github_organization
67+
token = local.github_token
7068

7169
dynamic "app_auth" {
7270
for_each = local.create_github_webhook && var.github_app_enabled ? [1] : []

0 commit comments

Comments
 (0)