Open ylupien opened 4 years ago
I encountered the same issue.
@ylupien have you managed to find a resolution for this?
Hey @ylupien @SouthernYoda, sorry for the delay. I've taken a quick look into the code but haven't managed to identify what's causing this behavior. Fixing this would require some debugging, which I don't currently have the time to do. I'll take a look into it as soon as I can, but in the mean time, feel free to take a look and submit a PR if you guys find anything
This appears to be a limitation of using GitHub inputs in this way, the input keys are automatically converted to uppercase as described in the documentation for GitHub inputs. It's too bad because I really like how you specified the inputs.
"When you specify an input to an action in a workflow file or use a default input value, GitHub creates an environment variable for the input with the name INPUT_
I've forked your repo and printed the "key" variable to console. The key value is already uppercase when it is read by the script.
A resolution might be to nest the input so the user enters in:
<arbitrary element name>:
key: <desired key>
value: <value>
<arbitrary element name>:
key: <desired key>
value: <value>
Hope this helped, I don't have experience with node so this is as much help as I can provide for now.
What about?:
json-content:
- key: foo
value: blub
- key: bar
value: buz
This would eliminate the unnecessary name for each element.
A workaround is to follow this step with jacobtomlinson/gha-find-replace@v2 to overwrite the uppercase inside the json.
I just forked the repo and converted all keys to be lowercase. If anyone needs that specific functionality, you can find it here: https://github.com/andrew-fennell/create-env-json
If you need specific capitalization (not all lowercase or uppercase), such as "Key", the current release of this repo (v2) and my fork (v3) will not work for you.
I believe the underlying issue is how GitHub handles the inputs.
Hi !
Look like I have an case issue with this github action. I specified lower case in the configuration and the generated file is in uppercase.
Any recommendation ?