Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
/ light-webhook Public archive

Simple webhook client. Receives requests from Github, Gitlab, or HTTP and executes HTTP request or Bash command.

License

Notifications You must be signed in to change notification settings

rpenco/light-webhook

Repository files navigation

light-webhook

Build Status npm version Package Quality NPM

👷 THIS VERSION IS UNDER DEVELOPMENT.
Use this version (1.0.6) or help me contributing.

✨ Overview

light-webhook is a lightweight application for receiving webhooks from different sources, processing them as streams and publishing the results in sinks.

🔥 Quick start example

Create a configuration.yml file with this following configuration.

name: github_webhook_to_bash_script             
stream:                             
    - name: github               
      type: github-source        
      settings:
        host: 127.0.0.0
        port: 8080
        path: /github
        events:
            - push
            - merge_request
      out:
        - console                 
        - bash                 

    # print received github request body 
    - name: console              
      type: console-sink         
      settings:                  
          format: json
    
    # execute custom script based on github request body
    - name: bash
      type: bash-sink
      settings:
          command: ./custom_script.sh
          args: ["--req", "{{@stringify(it)}}"]

Then launch application light-webhook -c configuration.yml and send Github webhook to http://127.0.0.1:8080/github. Voilà, you custom_script.sh will be executed with arguments based on received Github request

📕 Documentation

🪛 Run with NPM

NPM official page.

Simply install package with global option.

npm install -g light-webhook@2.0.0-alpha.1

Then execute your configuration.

light-webhook -c test/configuration.yaml

🪛 Run with Docker

Docker Hub official page.

You can pass your configuration using /conf/configuration.yaml mounted volume.

docker run --name light-webhook -v $(pwd)/test/configuration.yaml:/conf/configuration.yaml -p 8080:8080 rpenco/light-webhook:2.0.0-alpha.1

🪛 Run from Tarball

Download source from Github release page.

tar -xvf light-webhook-2.0.0-alpha.1.tgz
# (optional: set executable mode) chmod +x package/dist/light-webhook.js
./package/dist/light-webhook.js -c test/configuration.yaml

📄 Licences

MIT License

About

Simple webhook client. Receives requests from Github, Gitlab, or HTTP and executes HTTP request or Bash command.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •