Expected Behavior
github_repository_file should continue to support valid GitHub repository file paths that include a literal colon (:) in the filename, such as repro/example:one.yaml.
After creating a file at exactly repro/example:one.yaml with provider 6.11.0, upgrading to 6.11.1 should still allow refresh and plan to succeed.
Actual Behavior
After upgrading integrations/github from 6.11.0 to 6.11.1, terraform plan / tofu plan fails during refresh for existing github_repository_file resources whose file path contains :.
The provider returns:
Error: failed to build ID: unescaped separator in non-final part "repro/example:one.yaml"
This appears to come from github_repository_file building its resource ID with buildID(repo, file, branch), while buildID rejects : in all non-final parts.
Terraform Version
OpenTofu v1.11.5
on linux_amd64
+ provider registry.terraform.io/integrations/github v6.11.1
Affected Resource(s)
Terraform Configuration Files
terraform {
required_providers {
github = {
source = "integrations/github"
version = "6.11.1"
}
}
}
variable "github_token" {
type = string
sensitive = true
}
variable "owner" {
type = string
}
variable "repository" {
type = string
}
provider "github" {
token = var.github_token
owner = var.owner
}
resource "github_repository_file" "marker" {
repository = var.repository
branch = "main"
file = "repro/README.md"
commit_message = "create repro directory"
overwrite_on_create = true
content = "Files in this directory are managed by Terraform."
}
resource "github_repository_file" "colon_filename" {
repository = var.repository
branch = "main"
file = "repro/example:one.yaml"
commit_message = "manage colon filename repro"
overwrite_on_create = true
content = yamlencode({
apiVersion = "v1"
kind = "ConfigMap"
metadata = {
name = "example-one"
}
})
}
Steps to Reproduce
- Create an empty test repository with a
main branch.
- Apply the configuration above with
integrations/github 6.11.0 so the resource manages the literal path repro/example:one.yaml and stores it in state.
- Change only the provider version to
6.11.1.
- Run
terraform plan or tofu plan again.
- Observe refresh fail before planning completes.
Debug Output
Error: failed to build ID: unescaped separator in non-final part "repro/example:one.yaml"
In my original production case, the same failure occurred on existing file paths like:
trivial-apps/infra-misc/kyverno/irsa/tf/nes-backstage:nes-backstage.yaml
trivial-apps/infra-misc/kyverno/irsa/tf/ack:ack-rds-controller.yaml
trivial-apps/infra-misc/kyverno/irsa/tf/kube-system:s3-csi-driver-sa.yaml
Panic Output
N/A
Code of Conduct
Expected Behavior
github_repository_fileshould continue to support valid GitHub repository file paths that include a literal colon (:) in the filename, such asrepro/example:one.yaml.After creating a file at exactly
repro/example:one.yamlwith provider6.11.0, upgrading to6.11.1should still allow refresh and plan to succeed.Actual Behavior
After upgrading
integrations/githubfrom6.11.0to6.11.1,terraform plan/tofu planfails during refresh for existinggithub_repository_fileresources whosefilepath contains:.The provider returns:
This appears to come from
github_repository_filebuilding its resource ID withbuildID(repo, file, branch), whilebuildIDrejects:in all non-final parts.Terraform Version
Affected Resource(s)
github_repository_fileTerraform Configuration Files
Steps to Reproduce
mainbranch.integrations/github6.11.0so the resource manages the literal pathrepro/example:one.yamland stores it in state.6.11.1.terraform planortofu planagain.Debug Output
In my original production case, the same failure occurred on existing file paths like:
Panic Output
N/A
Code of Conduct