Repository navigation
Closed
Description
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.
terraform-provider-github/github/util.go
Lines 57 to 68 in 15fff78
| 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.
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't working as documented
Activity
github-actions commentedon Jan 21, 2026
👋 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! 🚀fix(parseID): separator in value
stevehipwell commentedon Jan 27, 2026
@acouvreur is this for an existing environment (e.g. one created before v6.10.x)?
acouvreur commentedon Jan 27, 2026
Yes
stevehipwell commentedon Jan 27, 2026
@acouvreur I've opened #3129 to fix this regression. I missed that
github_repository_environmentwould 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.