Skip to content

Commit 27d0fca

Browse files
committed
fix: change pages var for settings repository (#44)
1 parent 177a5bd commit 27d0fca

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

main.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ locals {
2323
path = "/"
2424
cname = ""
2525
}
26-
pages = merge(local.default_pages, var.pages)
2726

2827
}
2928

@@ -51,14 +50,14 @@ resource "github_repository" "this" {
5150
topics = var.topics
5251

5352
dynamic "pages" {
54-
for_each = [local.pages]
53+
for_each = length(var.pages) != 0 ? [var.pages] : []
5554

5655
content {
5756
source {
58-
branch = pages.value.branch
59-
path = pages.value.path
57+
branch = lookup(pages.value, "branch", local.default_pages.branch)
58+
path = lookup(pages.value, "path", local.default_pages.path)
6059
}
61-
cname = pages.value.cname
60+
cname = lookup(pages.value, "cname", local.default_pages.cname)
6261
}
6362
}
6463

0 commit comments

Comments
 (0)