Skip to content

Commit 0d40eab

Browse files
committed
Add a README
1 parent 4a05e0b commit 0d40eab

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# gh-hook-command
2+
Sets up a simple HTTP server. The only endpoint it serves is `POST /hook`. When
3+
a GitHub webhook is sent there, the request is validated, and the command
4+
specified in the configuration file is run.
5+
6+
## Installation
7+
```
8+
$ cargo build --release
9+
$ target/release/gh-hook-command
10+
```
11+
12+
## Configuration
13+
The path to the configuration file is set by the `GH_HOOK_CONFIG` environment
14+
variable. If it's unset, `./config.toml` is used instead. The file will be
15+
created if it doesn't exist.
16+
17+
```toml
18+
# The webhook secret key.
19+
secret = "secret secret really secret"
20+
21+
# Address to bind to.
22+
bind = "0.0.0.0:8000"
23+
24+
# The command list.
25+
[commands]
26+
# This runs `cat /dev/stdin && echo ""' on the `push` event.
27+
push = 'cat /dev/stdin && echo ""'
28+
```

0 commit comments

Comments
 (0)