Bitbucket Payload Reader
A payload reader for Bitbucket webhooks
Install like a development dependency
npm i -SD bitbucket-payload
How to use
Bitbucket payload reader accepts 2 parameters:
- bitbucketEventPayload: When you have a webhook with an event, Bitbucket sends the event request to the server URL for the webhook whenever that event occurs. e.g.
"actor": Owner "repository": Repository "push": ... ...
- repositoryEvent When configuring a webhook, you can choose which events you would like to receive payloads for. e.g. 'push', 'fork', 'updated'.
Code
const BitbucketPayload = ; const repositoryEvent = 'push';const bitbucketPayload = bitbucketEventPayload repositoryEvent;const payloadObject = bitbucketPayload;
Implementation in a webhook
'use strict';const app = ;const BitbucketPayload = ;// use in webhook requestapp
License
MIT © Jan Sanchez