Git post-receive hook to send GitHub PushEvent-formatted requests
Note, some github-specific payload fields are missing. The exact payload format can be found in payload.rs
.
See releases
for binaries, or build from source (see Releases
section below).
If you've installed a pre-compiled binary, you can update to the latest release via notify-hook self update
.
Sidenote: This is a rewrite of the python utility notify-webhook
Note: options are set (from within the git project) with:
git config notifyhook.hook-urls "https://httpbin.org/post,https://httpbin.org/post"
notifyhook.repo-name
Repository name to use. Defaults to blank
notifyhook.repo-description
Repository description to use. Defaults to blank
notifyhook.repo-owner-name
Repository owner name to use. Defaults to blank
notifyhook.repo-owner-email
Repository owner email to use. Defaults to blank
notifyhook.hook-urls
Comma separated list of urls to post content to.
notifyhook.secret-token
Optional: Hex encoded secret token used to generate a GitHub X-Hub-Signature header.
notifyhook.content-type
Content type to send payload as. Defaults to urlencoded
.
Options:
urlencoded
: (Default) Post asapplication/x-www-form-urlencoded
json
: Post asapplication/json
- Install
rust
cargo build
echo "6b1bc10c d7b4c1baba master" | cargo run -- --debug
Statically compiled releases are built by travis-ci with --features update
to allow notify-hook self update
.
If you want to fork this project and continue building/self-updating with your github releases, you'll need
to enable the notify-hook
repository in your travis-ci account and then update the update
function
to point to your forked github repository.
If you prefer to build locally, there are two options:
- If your build and target architectures are identical, you can get away with a simple
cargo build --release
. Note, this requireslibssl-dev
to be installed in your build environment, andopenssl
installed on your target. - If you want to build static releases, like those built by travis-ci, you can use the
build-release.py
script. This script requiresdocker
andcross
to be installed to produce statically compiled binaries. By default, artifacts will be produced fori686
andx86_64
. This can be tweaked in theTARGETS
list ofbuild-release.py
.- Install
docker
- Add yourself to the
docker
group:sudo usermod -a -G docker <user>
- Restart to pick up changes (logging in & out may suffice)
- You should be able to run
docker version
without any errors - May need to start the Docker daemon if it's not already running:
sudo systemctl start docker
- Add yourself to the
- Install
cross
:cargo install cross
./build-release.py
- Release artifacts (
i686
&x86_64
) will be copied intobin/32
&bin/64
- Release artifacts (
- Install