Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added php webhook

  • Loading branch information...
commit 4b870ff7f2640b83ba748e28e9d53d6ef91cb21d 1 parent fc9252e
@thousandsofthem thousandsofthem authored
18 php/github_webhook/
@@ -0,0 +1,18 @@
+# Github Webhook Worker
+This shows how to kick off a worker from a webhook. This example uses Github's Service Hooks.
+## Getting started
+- Download and put `iron.json` in current directory [more info](
+- Upload webhook via [CLI]( tool: `iron_worker upload github_webhook`
+- Go to Github Service Hooks: -> repository -> admin -> Service Hooks -> WebHook URLs
+- Assemble webhook url:
+Where `<project_id>` and `<token>`are same as `iron.json` contain, `GithubWebHook` is name of your worker
+- Enter webhook url
+- Click Update Settings
+- Click Test Hook
+- Check the worker status and logs in IronWorker at to ensure it ran successfully.
15 php/github_webhook/github_webhook.php
@@ -0,0 +1,15 @@
+# the payload we get from github needs to be decoded first
+$payload_raw = getPayload();
+parse_str($payload_raw, $payload);
+echo "Payload:";
+# Then we can parse the json
+$data = json_decode($payload['payload'], true);
+echo "data:";
+# Do something exciting here
3  php/github_webhook/github_webhook.worker
@@ -0,0 +1,3 @@
+name 'GithubWebHook'
+runtime 'php'
+exec 'github_webhook.php'
Please sign in to comment.
Something went wrong with that request. Please try again.