Closed lyricnz closed 1 month ago
I can't see how https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file actually supports uploading a binary file (there's no flag to let it know that the content is base64 encoded).
This commit totally doesn't work (for me) https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/commit/a514ce0ef5743b065c1f1788f0b9ec3d9d3650b0#diff-75d6741a4ff5654842d3a983ac5376d3485db0914e89f004825fda996162c569 @jayBana
My guess is that the actual error message comes from around here.
But due how the code looks as of now you should not get this exact message. This suggests that you use v5.43.0 or earlier of github provider. Is this the case? Can you try with newer version?
My last attempt was with opentofu:
❯ tofu --version
OpenTofu v1.8.1
on darwin_amd64
+ provider registry.opentofu.org/hashicorp/tls v4.0.5
+ provider registry.opentofu.org/integrations/github v4.31.0
PS: it "works fine" if I comment out the *.png
line in main.tf - but obviously doesn't include those files in the output repo.
Will reinstall terraform, and see which version it installed. Sec.
Even with latest terraform, and running terraform init
it installed that old version:
❯ terraform --version
Terraform v1.9.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/tls v4.0.5
+ provider registry.terraform.io/integrations/github v4.31.0
Updating required_providers to "~> 6.0"
❯ terraform --version
Terraform v1.9.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/tls v4.0.5
+ provider registry.terraform.io/integrations/github v6.2.3
Then applying the stock terraform, I didn't get any error, but the PNG is still corrupt:
Given there seems to be little to fix on our side, can we close this issue?
Maybe it would be worth it to mention this in the stage README, what do you think?
Yes, documenting "this process will corrupt any binary files, including PNG". In the alternative, maybe a non-terraform solution would work better?
Describe the bug
Applying fast/extras/0-cicd-github creates corrupted PNG output and ultimately fails with error.
Environment
Also tried with opentofu (same result)
To Reproduce Create a tfvars with any repo:
Execute: terraform init + apply
Look at PNG in the output - they are base64 encoded text, not the original binary content.
Expected behavior Files in the new repos to be intact, and mostly identical to the original.
Result Terraform output and/or error messages
Additional context Add any other context about the problem here