Skip to content

There is a syntax error in your templates file. Please fix for newer webhook users like myself. #627

@jdsjdk

Description

@jdsjdk

in the following file:
https://github.com/adnanh/webhook/blob/master/docs/Templates.md
There's a missing bracket at the beginning of the file. It should be this:
[ { "id": "webhook", "execute-command": "/home/adnan/redeploy-go-webhook.sh", "command-working-directory": "/home/adnan/go", "response-message": "I got the payload!", "response-headers": [ { "name": "Access-Control-Allow-Origin", "value": "*" } ], "pass-arguments-to-command": [ { "source": "payload", "name": "head_commit.id" }, { "source": "payload", "name": "pusher.name" }, { "source": "payload", "name": "pusher.email" } ], "trigger-rule": { "and": [ { "match": { "type": "payload-hmac-sha1", "secret": "{{ getenv \"XXXTEST_SECRET\" | js }}", "parameter": { "source": "header", "name": "X-Hub-Signature" } } }, { "match": { "type": "value", "value": "refs/heads/master", "parameter": { "source": "payload", "name": "ref" } } } ] } } ]
Every '[' should have a closing ']'. The beginning of the file doesn't have the '[' like it needs to.

Also you need to add escape characters around your environmental variables like I have in this example to avoid in valid json. I was kinda tearing the hair out of my head on this. So this:
"secret": "{{ getenv "XXXTEST_SECRET" | js }}",
Needs to become this:
"secret": "{{ getenv \"XXXTEST_SECRET\" | js }}",
Otherwise your webhooks won't work, and will have syntax errors. Have a great day! 😄 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions