Skip to content

Commit

Permalink
strip org name from deploy key repo (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludoo authored Apr 17, 2023
1 parent 09945a2 commit 9072c34
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fast/extras/0-cicd-github/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ resource "github_repository_deploy_key" "default" {
count = (
try(var.modules_config.key_config.create_key, null) == true ? 1 : 0
)
title = "Modules repository access"
repository = local.modules_repo
title = "Modules repository access"
# if an organization is part of the repo name, we need to strip it
# as the resource interpolates the provider org
repository = (
length(split("/", local.modules_repo)) == 1
? local.modules_repo
: split("/", local.modules_repo)[1]
)
key = (
try(var.modules_config.key_config.keypair_path, null) == null
? tls_private_key.default.public_key_openssh
Expand Down Expand Up @@ -184,4 +190,4 @@ resource "github_repository_pull_request" "default" {
depends_on = [
github_repository_file.default
]
}
}

0 comments on commit 9072c34

Please sign in to comment.