Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tigerfintech/gitlab-hook-handler
gitlab hook handler
https://github.com/tigerfintech/gitlab-hook-handler
Last synced: 16 days ago
JSON representation
gitlab hook handler
- Host: GitHub
- URL: https://github.com/tigerfintech/gitlab-hook-handler
- Owner: tigerfintech
- Created: 2018-10-14T15:07:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T12:51:18.000Z (almost 2 years ago)
- Last Synced: 2024-09-17T19:55:36.475Z (about 2 months ago)
- Language: JavaScript
- Size: 554 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Install
yarn add gitlab-hook-handler
// or
npm i gitlab-hook-handler
### Usage with Koa
import Koa from 'koa';
import createHandler from 'gitlab-hook-handler';const app = new Koa();
const handler = createHandler({
path: '/gitlab-webhook',
secret: 'xxx' // optional
});// or multiple hooks
const handler = createHandler([
{
path: '/hook1',
secret: 'xxx' // optional
},
{
path: '/hook2',
secret: 'xxx' // optional
}
])// you can listen on merge_request, note, push, tag_push ...
handler.on('merge_request', function (event) {
const { eventName, payload, pathname, host, url, protocol } = event;// do something
});handler.on('*', function (event) {
const { eventName, payload, pathname, host, url, protocol } = event;// do something
})