Skip to content
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
11 changes: 11 additions & 0 deletions terraform/github/labels.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
resource "github_issue_label" "standard" {
for_each = local.repo_labels

# each.value.repository is a plain string (repo name), not a reference to
# module.repository — without this explicit depends_on, Terraform has no
# graph edge between the two and may schedule label creation in parallel
# with a brand-new repository's own creation. Observed in practice: 9 of
# 17 labels for a freshly-created repo failed with
# "POST .../labels: 404 Not Found" because the GitHub API hadn't finished
# propagating the new repo yet. Existing repos never hit this (their
# labels already exist, so it's a no-op diff), which is why it went
# unnoticed until the next brand-new repository.
depends_on = [module.repository]

repository = each.value.repository
name = each.value.name
color = each.value.color
Expand Down
Loading