-
Notifications
You must be signed in to change notification settings - Fork 26
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
build.message will break JSON format #34
Comments
How should a new line break the JSON format? It's still properly quoted and valid JSON. |
I am also having this issue, no JSON parser (that are compliant with the JSON spec) will accept this object.
Per RFC7159, Section 7. Strings:
|
The RenderTrim method of drone-template-lib is processed, but there is no space before the newline character at the end of the message, resulting in invalid processing. My message example:
func RenderTrim(template string, playload interface{}) (string, error) {
out, err := Render(template, playload)
return strings.Trim(out, " \n"), err
} |
That's not the issue. You are getting the implementation of trim wrong, you can see it at https://golang.org/pkg/strings/#Trim. |
Just a guess, but maybe you can use to Json from http://masterminds.github.io/sprig/defaults . html to properly format the message in json. |
Seems that |
Trigger from git source add You can try |
This is my webhook part of .drone.yml
When I push commit and my commit message is "test" (
git commit -m "test"
),webhook will parse result as below
Output result from drone.io:
How can I fix this ?
The text was updated successfully, but these errors were encountered: