Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade@8316143220 #222

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions terraform/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ resource "github_branch_protection" "this" {

pattern = each.value.pattern

repository_id = github_repository.this[split(":", each.key)[0]].node_id
repository_id = lookup(each.value, "repository_id", lookup(lookup(github_repository.this, lower(lookup(each.value, "repository", "")), {}), "node_id", null))

allows_deletions = try(each.value.allows_deletions, null)
allows_force_pushes = try(each.value.allows_force_pushes, null)
Expand Down Expand Up @@ -169,7 +169,7 @@ resource "github_team_repository" "this" {
repository = each.value.repository
permission = each.value.permission

team_id = github_team.this[split(":", each.key)[0]].id
team_id = lookup(each.value, "team_id", lookup(lookup(github_team.this, lower(lookup(each.value, "team", "")), {}), "id", null))

lifecycle {
ignore_changes = []
Expand All @@ -182,7 +182,7 @@ resource "github_team_membership" "this" {
username = each.value.username
role = each.value.role

team_id = github_team.this[split(":", each.key)[0]].id
team_id = lookup(each.value, "team_id", lookup(lookup(github_team.this, lower(lookup(each.value, "team", "")), {}), "id", null))

lifecycle {
ignore_changes = []
Expand All @@ -197,7 +197,7 @@ resource "github_repository_file" "this" {
content = each.value.content
# Since 5.25.0 the branch attribute defaults to the default branch of the repository
# branch = try(each.value.branch, null)
branch = github_repository.this[each.value.repository].default_branch
branch = lookup(each.value, "branch", lookup(lookup(github_repository.this, each.value.repository, {}), "default_branch", null))
overwrite_on_create = try(each.value.overwrite_on_create, true)
# Keep the defaults from 4.x
commit_author = try(each.value.commit_author, "GitHub")
Expand Down
Loading