You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the awesome package. I'm currently using it to read/write GitHub Actions (GHA) workflow files in my new R package / GH Action called rworkflows.
I have a scenario where I have a GHA workflow yaml that has the key "on". Thanks to the handler arg I managed to read in the yaml file.
However, I couldn't seem to figure out how to prevent the "on" key being written as 'on': (in single quotes) instead of on: when writing back to disk with write_yaml. This is an issue for GHA as their parser doesn't recognize keys with quotes.
After some playing around, I figured out that the solution was substituting the quoted character and then using file(..., raw=TRUE), but this feature isn't currently exposed to users via write_yaml (as far as I can tell).
Ah, actually I've just realized that I had misinterpreted the GHA error messages. These were happening bc i had forgotten to include the branch: part. This works fine, regardless of whether 'on': is quoted or not.
Still, if you think the raw arg might be helpful, still happy to add it.
This package sees a lot of traffic. I'm open to pull requests. The number one constraint is things can be added, but no existing behavior can be changed.
Hello!,
Thanks for the awesome package. I'm currently using it to read/write GitHub Actions (GHA) workflow files in my new R package / GH Action called
rworkflows
.I have a scenario where I have a GHA workflow yaml that has the key "on". Thanks to the
handler
arg I managed to read in the yaml file.However, I couldn't seem to figure out how to prevent the "on" key being written as
'on':
(in single quotes) instead ofon:
when writing back to disk withwrite_yaml
. This is an issue for GHA as their parser doesn't recognize keys with quotes.After some playing around, I figured out that the solution was substituting the quoted character and then using
file(..., raw=TRUE)
, but this feature isn't currently exposed to users viawrite_yaml
(as far as I can tell).Reprex
Issue
yaml file looks like:
Solution
If it's helpful, I'd be happy to implement the raw arg in
write_yaml
and make a Pull Request. Does that sound ok to you (maintainer[s])?Thanks!,
Brian
Session info
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] yaml_2.3.6
loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1
The text was updated successfully, but these errors were encountered: