{"action":"created","comment":{"url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/comments/75529734","id":75529734,"diff_hunk":"@@ -226,6 +226,60 @@ function pullRequestEvent(request, reply) {\n }\n \n /**\n+ * Act on a Push event\n+ *  - Should start a new main job\n+ * @method pushEvent\n+ * @param  {Hapi.request}       request Request from user\n+ * @param  {Hapi.reply}         reply   Reply to user\n+ */\n+function pushEvent(request, reply) {\n+    const pipelineFactory = request.server.app.pipelineFactory;\n+    const jobFactory = request.server.app.jobFactory;\n+    const buildFactory = request.server.app.buildFactory;\n+    const eventId = request.headers['x-github-delivery'];\n+    const payload = request.payload;\n+    const repository = hoek.reach(payload, 'repository.ssh_url');\n+    const branch = hoek.reach(payload, 'ref').replace(/^refs\\/heads\\//, '');\n+    const sha = hoek.reach(payload, 'after');\n+    const username = hoek.reach(payload, 'sender.login');\n+    const scmUrl = `${repository}#${branch}`;\n+    const apiUri = request.server.info.uri;","path":"plugins/webhooks/github.js","position":21,"original_position":21,"commit_id":"4df6a115a383c496c62cafef56fe9a5a3158899c","original_commit_id":"4df6a115a383c496c62cafef56fe9a5a3158899c","user":{"login":"stjohnjohnson","id":622065,"avatar_url":"https://avatars.githubusercontent.com/u/622065?v=3","gravatar_id":"","url":"https://api.github.com/users/stjohnjohnson","html_url":"https://github.com/stjohnjohnson","followers_url":"https://api.github.com/users/stjohnjohnson/followers","following_url":"https://api.github.com/users/stjohnjohnson/following{/other_user}","gists_url":"https://api.github.com/users/stjohnjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/stjohnjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stjohnjohnson/subscriptions","organizations_url":"https://api.github.com/users/stjohnjohnson/orgs","repos_url":"https://api.github.com/users/stjohnjohnson/repos","events_url":"https://api.github.com/users/stjohnjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/stjohnjohnson/received_events","type":"User","site_admin":false},"body":"nope, it's gone.","created_at":"2016-08-19T18:26:22Z","updated_at":"2016-08-19T18:26:22Z","html_url":"https://github.com/screwdriver-cd/screwdriver/pull/113#discussion_r75529734","pull_request_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/comments/75529734"},"html":{"href":"https://github.com/screwdriver-cd/screwdriver/pull/113#discussion_r75529734"},"pull_request":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113","id":81909508,"html_url":"https://github.com/screwdriver-cd/screwdriver/pull/113","diff_url":"https://github.com/screwdriver-cd/screwdriver/pull/113.diff","patch_url":"https://github.com/screwdriver-cd/screwdriver/pull/113.patch","issue_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/113","number":113,"state":"open","locked":false,"title":"Adding push support","user":{"login":"stjohnjohnson","id":622065,"avatar_url":"https://avatars.githubusercontent.com/u/622065?v=3","gravatar_id":"","url":"https://api.github.com/users/stjohnjohnson","html_url":"https://github.com/stjohnjohnson","followers_url":"https://api.github.com/users/stjohnjohnson/followers","following_url":"https://api.github.com/users/stjohnjohnson/following{/other_user}","gists_url":"https://api.github.com/users/stjohnjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/stjohnjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stjohnjohnson/subscriptions","organizations_url":"https://api.github.com/users/stjohnjohnson/orgs","repos_url":"https://api.github.com/users/stjohnjohnson/repos","events_url":"https://api.github.com/users/stjohnjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/stjohnjohnson/received_events","type":"User","site_admin":false},"body":"This will trigger the main job on push to the branch.","created_at":"2016-08-19T00:21:08Z","updated_at":"2016-08-19T18:26:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3d8e46103c68f726340305a2f6cb293aeb29257","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113/commits","review_comments_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113/comments","review_comment_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/113/comments","statuses_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/statuses/4df6a115a383c496c62cafef56fe9a5a3158899c","head":{"label":"screwdriver-cd:AddPush","ref":"AddPush","sha":"4df6a115a383c496c62cafef56fe9a5a3158899c","user":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"repo":{"id":59517730,"name":"screwdriver","full_name":"screwdriver-cd/screwdriver","owner":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/screwdriver-cd/screwdriver","description":"Screwdriver API powered by Hapi.js","fork":false,"url":"https://api.github.com/repos/screwdriver-cd/screwdriver","forks_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/forks","keys_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/teams","hooks_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/hooks","issue_events_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/events{/number}","events_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/events","assignees_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/assignees{/user}","branches_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/branches{/branch}","tags_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/tags","blobs_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/statuses/{sha}","languages_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/languages","stargazers_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/stargazers","contributors_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/contributors","subscribers_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/subscribers","subscription_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/subscription","commits_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/contents/{+path}","compare_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/merges","archive_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/downloads","issues_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues{/number}","pulls_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls{/number}","milestones_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/milestones{/number}","notifications_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/labels{/name}","releases_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/releases{/id}","deployments_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/deployments","created_at":"2016-05-23T20:55:35Z","updated_at":"2016-07-27T21:52:57Z","pushed_at":"2016-08-19T18:15:48Z","git_url":"git://github.com/screwdriver-cd/screwdriver.git","ssh_url":"git@github.com:screwdriver-cd/screwdriver.git","clone_url":"https://github.com/screwdriver-cd/screwdriver.git","svn_url":"https://github.com/screwdriver-cd/screwdriver","homepage":"https://hub.docker.com/r/screwdrivercd/screwdriver/","size":218,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":2,"default_branch":"master"}},"base":{"label":"screwdriver-cd:master","ref":"master","sha":"a63970401244ee12064d3e3899445235e012bc7e","user":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"repo":{"id":59517730,"name":"screwdriver","full_name":"screwdriver-cd/screwdriver","owner":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/screwdriver-cd/screwdriver","description":"Screwdriver API powered by Hapi.js","fork":false,"url":"https://api.github.com/repos/screwdriver-cd/screwdriver","forks_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/forks","keys_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/teams","hooks_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/hooks","issue_events_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/events{/number}","events_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/events","assignees_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/assignees{/user}","branches_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/branches{/branch}","tags_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/tags","blobs_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/statuses/{sha}","languages_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/languages","stargazers_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/stargazers","contributors_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/contributors","subscribers_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/subscribers","subscription_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/subscription","commits_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/contents/{+path}","compare_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/merges","archive_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/downloads","issues_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues{/number}","pulls_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls{/number}","milestones_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/milestones{/number}","notifications_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/labels{/name}","releases_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/releases{/id}","deployments_url":"https://api.github.com/repos/screwdriver-cd/screwdriver/deployments","created_at":"2016-05-23T20:55:35Z","updated_at":"2016-07-27T21:52:57Z","pushed_at":"2016-08-19T18:15:48Z","git_url":"git://github.com/screwdriver-cd/screwdriver.git","ssh_url":"git@github.com:screwdriver-cd/screwdriver.git","clone_url":"https://github.com/screwdriver-cd/screwdriver.git","svn_url":"https://github.com/screwdriver-cd/screwdriver","homepage":"https://hub.docker.com/r/screwdrivercd/screwdriver/","size":218,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113"},"html":{"href":"https://github.com/screwdriver-cd/screwdriver/pull/113"},"issue":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/113"},"comments":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/screwdriver-cd/screwdriver/statuses/4df6a115a383c496c62cafef56fe9a5a3158899c"}}}}
{"actor":{"display_login":"stjohnjohnson"}}