Skip to content

build.message will break JSON format #34

Description

@Vergil0327

This is my webhook part of .drone.yml

template: |
{
"event": "{{ build.event }}",
"owner": "{{ repo.owner }}",
"repo": "{{ repo.name }}",
"message": "{{ build.message }}",
}

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:

HEADERS: map[Content-Type:[application/json]]
REQUEST BODY: {
"event": "push",
"owner": "owner",
"repo": "test",
"message": "test <--- new line will break JSON format and ERROR occured
"
}

How can I fix this ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions