Skip to content

[BUG]: github_repository_file rejects valid file paths containing ':' in v6.11.1 #3335

Closed

Description

@dannysauer

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)

  • github_repository_file

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

  1. Create an empty test repository with a main branch.
  2. 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.
  3. Change only the provider version to 6.11.1.
  4. Run terraform plan or tofu plan again.
  5. 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

  • I agree to follow this project's Code of Conduct

Activity

  1. github-actions commented on Apr 13, 2026

    @github-actions

    👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

  2. added
    Status: Triage
    Type: Bug
    on May 10, 2026
  3. added theissue type on May 10, 2026
  4. self-assigned this
    on May 10, 2026
  5. added
    vNextPatch
    on May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Status: TriageType: Bugr/repository_filevNextPatch

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions