Skip to content

Regression: environments cannot have : charcaters #3105

Closed

Description

@acouvreur

Introduced by: https://github.com/integrations/terraform-provider-github/blame/15fff783674a8c26cf536a3f84ef662520baccb7/github/resource_github_repository_environment.go#L234

Our environments have the : character, and since update v6.10.0 we can no longer use the provider to provision our environments.

We have the following error message:

Error: unexpected ID format ("some-repository:my:environment")

Where we have one environment named my:environment.


I can probably do a fix, but the issue is that everything relies on the parseID method which ensures that it properly split into a given count.

func parseID(id string, count int) ([]string, error) {
if len(id) == 0 {
return nil, fmt.Errorf("id is empty")
}
parts := strings.Split(id, idSeparator)
if len(parts) != count {
return nil, fmt.Errorf("unexpected ID format (%q); expected %d parts separated by %q", id, count, idSeparator)
}
return parts, nil
}


I would fix this by ensuring that parseID2 splits in at least 2, and collect all the remaining splits in the second argument. Same for 3. Or by using a different separator but I'm not sure what the implications would be.

I'll do a PR and you'll give me some feedback.

Activity

  1. github-actions commented on Jan 21, 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 a commit that references this issue on Jan 21, 2026
  3. stevehipwell commented on Jan 27, 2026

    @stevehipwell
    Collaborator

    @acouvreur is this for an existing environment (e.g. one created before v6.10.x)?

  4. acouvreur commented on Jan 27, 2026

    @acouvreur
    ContributorAuthor

    @acouvreur is this for an existing environment (e.g. one created before v6.10.x)?

    Yes

  5. stevehipwell commented on Jan 27, 2026

    @stevehipwell
    Collaborator

    @acouvreur I've opened #3129 to fix this regression. I missed that github_repository_environment would work fine without the IDs being escaped as all the other resources were broken by the lack of escaping :.

    If you want to fix this before the next release you can remove and then re-import the resource using the correctly escaped ID.

  6. self-assigned this
    on Jan 27, 2026
  7. added
    Type: Bug
    on Jan 27, 2026
  8. added this to the v6.11.0 Release milestone on Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions