-
Notifications
You must be signed in to change notification settings - Fork 915
Closed
Description
Hi there,
Terraform Version
Terraform v1.1.9
Affected Resource(s)
- github_repository
Terraform Configuration Files
resource "github_repository" "repository" {
for_each = var.repositories
name = each.key
description = each.value.description
homepage_url = each.value.homepage_url
allow_merge_commit = each.value.allow_merge_commit
allow_rebase_merge = each.value.allow_rebase_merge
allow_squash_merge = each.value.allow_squash_merge
has_downloads = each.value.has_downloads
has_issues = each.value.has_issues
has_projects = each.value.has_projects
has_wiki = each.value.has_wiki
vulnerability_alerts = each.value.vulnerability_alerts
visibility = each.value.visibility == null ? "private" : each.value.visibility
lifecycle {
ignore_changes = [
# branches are very slow to update and unused anyway
branches,
]
}
}
Expected Behavior
- use value from repository by default when there no such field in definition
Actual Behavior
- errors, need to rerun apply to remove errors
Steps to Reproduce
Organization with forks disabled, private repository, 4.23.0 of provider
then update provider (without adding allow_forking) and apply
Error: PATCH https://api.github.com/repos/org/repo: 422 This organization does not allow private repository forking []
with github_repository.repository["repo"],
on github-main.tf line 8, in resource "github_repository" "repository":
8: resource "github_repository" "repository" {
but if run apply second time - everything is fine (and state has allow_forking == true, while really forking is disabled)
then if I disable allow_forking explicitly the error returns
allow_forking = false # forcefully disable forks
output
Error: PATCH https://api.github.com/repos/org/repo: 422 This organization does not allow private repository forking []
with github_repository.repository["repo"],
on github-main.tf line 8, in resource "github_repository" "repository":
8: resource "github_repository" "repository" {
but again if run apply second time , then everything is fine
References
burgersource, Ka1wa, jaredfholgate, barezkiBM, iniinikoski and 3 more
Metadata
Metadata
Assignees
Labels
No labels