ipdxco / github-as-code

GitHub Configuration as Code
19 stars 7 forks source link

fix: allow deleting teams associated with archived repositories #125

Closed galargh closed 7 months ago

galargh commented 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).

BTW, coalesce doesn't either, so something like this would work too:

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.