Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document start header --- is removed when setting head comment #2186

Open
solidDoWant opened this issue Nov 5, 2024 · 0 comments
Open

Document start header --- is removed when setting head comment #2186

solidDoWant opened this issue Nov 5, 2024 · 0 comments
Labels

Comments

@solidDoWant
Copy link

Describe the bug

When calling head_comment, the document header is always removed.

Version of yq: 4.44.3
Operating system: linux
Installed via: container image

Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:

---
this: should really work

Command
The command you ran:

yq '. head_comment="Example"' data1.yml

Here's a single line command to reproduce this example: printf -- '---\nthis: should really work\n' | yq '. head_comment="Example"'

Actual behavior

# Example
this: should really work

Expected behavior

---
# Example
this: should really work

Additional context
Seems to be another instance of these bugs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant