rvagg / github-webhook

A flexible web server for reacting GitHub Webhooks
MIT License
116 stars 24 forks source link

exec command not executed #2

Closed antoineco closed 9 years ago

antoineco commented 9 years ago

We are running the latest version of this project from npm (1.1.1), it seems to catch all the webhooks from GitHub but the command defined as exec is never executed.

root@d979bd282a48:~# DEBUG=* /usr/local/bin/github-webhook --port=8080 --path=/webhook --secret=bla --rule='::echo PUSHED'

  github-webhook:server Listening on http://0.0.0.0:8080 +0ms
  github-webhook:server Connection from 172.17.0.6:8080 +35s
  github-webhook:events {"event":"push","id":"f00d2000-1a86-11e5-8149-af6f7cb0d1ba","payload":{"ref":"refs/heads/jekyll-test","before":"0bdc97740656ed06a90aacd2d761da662bbcee6e","after":"9872ab119fc7062554586a0c3c26131f9dec03fe","created":false,"deleted":false,"forced":false,"base_ref":null,"compare":"https://github.com/[...]} +5ms

We've tried to touch a file as well, or to use a match rule as follows, but nothing worked.

root@d979bd282a48:~# DEBUG=* /usr/local/bin/github-webhook --port=8080 --path=/webhook --secret=bla --rule='push:ref == refs/heads/jekyll-test:echo PUSHED'

Are we missing anything?

danilobuerger commented 9 years ago

nc30d

rvagg commented 9 years ago

I've just published a new version with updated dependencies, not sure that'll change anything but worth trying.

Run it with DEBUG=* prefixed on the commandline and it should print some debugging output and may give you hints as to what's going on. To be honest I only use the config file variant of this package so it could be the commandline rules are falling apart somewhere.

rvagg commented 9 years ago

sorry, you are using DEBUG=*

it's likely that your rule is not working, it's using matchme and it can be a bit picky. For instance, you probably need to surround your ref with "'s: --rule='push:ref == "refs/heads/jekyll-test":echo PUSHED'

rvagg commented 9 years ago

aaaand, * for "all events", not blank

antoineco commented 9 years ago

Thank you very much for the help, that was indeed an issue with the quotes! And nice project :+1: