Skip to content

A nodejs application which listens for GitHub webhook and run custom shell.

License

Notifications You must be signed in to change notification settings

Comdex/cherry-hook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

cherry-hook

An application which listens for GitHub webhook and start custom task.

update: support secret verify, action keyword trigger and custom commit action.

How to use

Configurate your repository

First of all, you need to configurate the webhook of your repository.

  • Go to your repository's setting. Add a webhook, set json format.
  • Set the Payload URL to your server. If you don't want to use the 80 port, then set it like this https://your.domain.name:8888.
  • Click confirm button.

Using this tool

  • Clone into your favorite folder. git clone https://github.com/robinxb/cherry-hook.git
  • npm install
  • Edit the config.json, create/modify the shell you want to use.
  • ./cherry-hook.js

FAQ

When runing a shell, Error: spawn EACCES shows up ?

There could be two reasons.

One is because of the shell is not an executable file. Simply use chmod +X path/to/the/shell.

Another is because nodejs don't have the permission to run some shell command, such as touch.

You can check current user via command $USER in your scripts.

If there's any future problem, notify me by issues.

Is the shell runs in synchronously?

No, synchronously is not recommanded and due to the function execFile in nodejs, it's synchronous.

Are the HTTP requests get handled in queue?

Yes. And don't worry about too many requests coming at one time, cherry-hook run shells asynchronously.

Roadmap

  • Add hot-reload config.json.
  • Custom Payload URL in config.json
  • Custom the method of triggering hot-reload.

License

MIT

About

A nodejs application which listens for GitHub webhook and run custom shell.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.0%
  • Shell 4.0%