Closed galargh closed 7 months ago
As it turns out, lookup doesn't suffer from the same issue try does (see https://github.com/ipdxco/github-as-code/pull/123).
lookup
try
BTW, coalesce doesn't either, so something like this would work too:
coalesce
repository_id = coalesce(try(each.value.repository_id, null), lookup(lookup(github_repository.this, lower(try(each.value.repository, "")), {}), "node_id", null))
This change is only useful in the context of dealing with archived repos - in particular, it will ensure that when we try to delete a team that is associated with an archived repo, github as code doesn't freak out.
As it turns out,
lookup
doesn't suffer from the same issuetry
does (see https://github.com/ipdxco/github-as-code/pull/123).BTW,
coalesce
doesn't either, so something like this would work too:This change is only useful in the context of dealing with archived repos - in particular, it will ensure that when we try to delete a team that is associated with an archived repo, github as code doesn't freak out.