-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure that origin url is trimmed not only for github
Signed-off-by: Andrey Devyatkin <[email protected]>
- Loading branch information
1 parent
4d1cf34
commit 36831c9
Showing
2 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ override.tf.json | |
# example: *tfplan* | ||
|
||
/.idea/ | ||
.terraform.lock.hcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,15 @@ locals { | |
gc_ttl = "${local.main_prefix}${var.separator}garbage-collector${var.separator}time-to-live" | ||
gc_other = "${local.main_prefix}${var.separator}garbage-collector${var.separator}other" | ||
|
||
git_origin_url = trimprefix(trimprefix(trimsuffix(lower(data.external.git_origin_url.result["Result"]), ".git"), "[email protected]:"), "https://github.com/") | ||
# We are dealing with situation when url will be one of those two | ||
# [email protected]:fivexl/terraform-aws-tag-generator.git | ||
# https://github.com/fivexl/terraform-aws-tag-generator.git | ||
# So what we do is we trim off possible prefixes - git@ and https:// | ||
# as well as suffix .git | ||
# final step we replace : in case of git based url to / so the result will be the same string | ||
# no matter what type of download is being used | ||
git_origin_url = replace(trimprefix(trimprefix(trimsuffix(lower(data.external.git_origin_url.result["Result"]), ".git"), "git@"), "https://"), ":", "/") | ||
|
||
git_module_source = lower(data.external.git_module_source.result["Result"]) | ||
|
||
git_remote_value = local.git_origin_url != "" ? { (local.git_remote) = local.git_origin_url } : {} | ||
|