`-` is not supported in the key from version 1.5 but is supported in 1.4. Can we please take a look here ? This is a very basic use case.
raghavharness opened this issue · 2 comments
.env file content:
go-version=hello
Error while reading this file:
unexpected character "-" in variable name near "go-version=hello\n"
The same works with 1.4 version.
@joho Request you to take a look into this.
Thanks for raising.
While this could count as a regression against past versions, I'm counting this as undefined behaviour, and won't be fixing it.
I've gone and tested against the upstream ruby library and that format isn't supported there.
It even syntax highlights funny in vim which is a reasonable leading indicator that usage is NQR.
@joho I wanted to provide some additional context. Although bash does not support dashes in environment variables, they are supported by some operating system syscalls [1], and they are valid on windows. GitHub Actions supports environment files [2] and they allow dashes as well, and we are using this library to parse the GitHub Actions env files. For better or worse, many GitHub Actions output variables with dashes.
We completely understand they may be out of scope for this library, especially if you are tracking compatibility with the ruby version. We are going to keep an internal fork to patch the behavior, but if you ever change your mind, we would be happy to contribute back.
[1] https://go.dev/play/p/YWrwwVVLhAK
[2] https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files