Skip to content

A simple server that runs a command when it gets a GitHub webhook event.

License

Notifications You must be signed in to change notification settings

Fingercomp/gh-hook-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-hook-command

Sets up a simple HTTP server. The only endpoint it serves is POST /hook. When a GitHub webhook is sent there, the request is validated, and the command specified in the configuration file is run.

Installation

$ cargo build --release
$ target/release/gh-hook-command

Configuration

The path to the configuration file is set by the GH_HOOK_CONFIG environment variable. If it's unset, ./config.toml is used instead. The file will be created if it doesn't exist.

# The webhook secret key.
secret = "secret secret really secret"

# Address to bind to.
bind = "0.0.0.0:8000"

# The command list.
[commands]
# This runs `cat /dev/stdin && echo ""' on the `push` event.
push = 'cat /dev/stdin && echo ""'

About

A simple server that runs a command when it gets a GitHub webhook event.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages