-
Notifications
You must be signed in to change notification settings - Fork 834
Closed as not planned
Closed as not planned
Copy link
Labels
Status: StaleUsed by stalebot to clean houseUsed by stalebot to clean houseType: BugSomething isn't working as documentedSomething isn't working as documentedr/repository_file
Description
(I had already opened an issue about this in the old repo, but after it moved here, seems to have been lost...)
Terraform Version
Terraform v0.14.5
Affected Resource(s)
- github_repository_file
Terraform Configuration Files
resource "github_repository_file" "file" {
for_each = {
for x in flatten([
for name, repo in var.repos : [
for file in fileset("templates", "${repo.template}/**") : {
repo = name
file = trimprefix(file, "${repo.template}/")
template = repo.template
}
] if can(repo.template) && lookup(repo, "archived", false) == false
]) : "${x.repo}:${x.file}" => x
}
repository = each.value.repo
branch = github_branch_default.default[each.value.repo].branch
file = each.value.file
content = file("templates/${each.value.template}/${each.value.file}")
commit_message = "chore(template): update ${each.value.file}"
overwrite_on_create = true
depends_on = [
github_repository.repository
]
}
Expected Behavior
Should not be sending empty commits with the file content not having changed!
Actual Behavior
when running terraform plan
everything looks correct, and there is no indication that any modifications to the referenced files will be triggered, but when running terraform apply
a whole bunch of empty commits are sent with the same commit message template
see this repo for a recent example: https://github.com/ahmadnassri/node-glob-promise/commits/master
all the commits starting with chore(template)
are an example of this
I tried adding
lifecycle {
ignore_changes = [
commit_message
]
}
but that simply re-uses whatever the previous commit message was for the file and commits anyways!
billxinli, simontabor, thiagola92, mloskot, atorrescogollo and 1 more
Metadata
Metadata
Assignees
Labels
Status: StaleUsed by stalebot to clean houseUsed by stalebot to clean houseType: BugSomething isn't working as documentedSomething isn't working as documentedr/repository_file