{"action":"created","comment":{"url":"https://api.github.com/repos/pebble/git-deploy/pulls/comments/74500872","id":74500872,"diff_hunk":"@@ -3,10 +3,29 @@\n source ~/.profile\n set -o pipefail\n \n-if [ ! -z \"$HOOK_REPO\" ]; then\n-\thook_dir=\"/git/hooks\"\n-else\n-\thook_dir=\"../hooks\"\n-fi\n-[ ! -f \"$hook_dir/post-receive\" ] || bash $hook_dir/post-receive | tee /var/log/git-deploy/hooks.log\n-/git/git-shell-commands/backup\n+unset GIT_DIR\n+cd ..\n+\n+while read oldrev newrev refname; do\n+\n+\t# source config.env from incoming HEAD if it exists\n+\tgit ls-tree --name-only -r $newrev | grep -Fx config.env >> /dev/null\n+\tif [ $? -eq 0 ]; then\n+\t\tsource <(git cat-file blob $newrev:config.env)","path":"base-hooks/post-receive","position":19,"original_position":19,"commit_id":"ad07a0adcb175c3f8667222a0caf3779aa8743a0","original_commit_id":"ad07a0adcb175c3f8667222a0caf3779aa8743a0","user":{"login":"thepwagner","id":1559510,"avatar_url":"https://avatars.githubusercontent.com/u/1559510?v=3","gravatar_id":"","url":"https://api.github.com/users/thepwagner","html_url":"https://github.com/thepwagner","followers_url":"https://api.github.com/users/thepwagner/followers","following_url":"https://api.github.com/users/thepwagner/following{/other_user}","gists_url":"https://api.github.com/users/thepwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/thepwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thepwagner/subscriptions","organizations_url":"https://api.github.com/users/thepwagner/orgs","repos_url":"https://api.github.com/users/thepwagner/repos","events_url":"https://api.github.com/users/thepwagner/events{/privacy}","received_events_url":"https://api.github.com/users/thepwagner/received_events","type":"User","site_admin":false},"body":"I get this is pasta from pre-receive; just never noticed how easy it is to inject shell code here before :P","created_at":"2016-08-11T20:53:26Z","updated_at":"2016-08-11T20:53:26Z","html_url":"https://github.com/pebble/git-deploy/pull/48#discussion_r74500872","pull_request_url":"https://api.github.com/repos/pebble/git-deploy/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/pebble/git-deploy/pulls/comments/74500872"},"html":{"href":"https://github.com/pebble/git-deploy/pull/48#discussion_r74500872"},"pull_request":{"href":"https://api.github.com/repos/pebble/git-deploy/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/pebble/git-deploy/pulls/48","id":80989150,"html_url":"https://github.com/pebble/git-deploy/pull/48","diff_url":"https://github.com/pebble/git-deploy/pull/48.diff","patch_url":"https://github.com/pebble/git-deploy/pull/48.patch","issue_url":"https://api.github.com/repos/pebble/git-deploy/issues/48","number":48,"state":"open","locked":false,"title":"WEBOPS-821: Unique hook per environment","user":{"login":"DeviaVir","id":777823,"avatar_url":"https://avatars.githubusercontent.com/u/777823?v=3","gravatar_id":"","url":"https://api.github.com/users/DeviaVir","html_url":"https://github.com/DeviaVir","followers_url":"https://api.github.com/users/DeviaVir/followers","following_url":"https://api.github.com/users/DeviaVir/following{/other_user}","gists_url":"https://api.github.com/users/DeviaVir/gists{/gist_id}","starred_url":"https://api.github.com/users/DeviaVir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeviaVir/subscriptions","organizations_url":"https://api.github.com/users/DeviaVir/orgs","repos_url":"https://api.github.com/users/DeviaVir/repos","events_url":"https://api.github.com/users/DeviaVir/events{/privacy}","received_events_url":"https://api.github.com/users/DeviaVir/received_events","type":"User","site_admin":false},"body":"> This allows external hooks to be defined per environment, allowing git-deploy to be used simultaneously by multiple people running different hook versions.\r\n\r\nThis is a rework of https://github.com/pebble/git-deploy/pull/45\r\n\r\ntested on `develop` 🏁 ","created_at":"2016-08-11T16:33:02Z","updated_at":"2016-08-11T20:53:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc1d1af2876fff1a727396ac4cc6d5f8648c5302","assignee":{"login":"lrvick","id":69200,"avatar_url":"https://avatars.githubusercontent.com/u/69200?v=3","gravatar_id":"","url":"https://api.github.com/users/lrvick","html_url":"https://github.com/lrvick","followers_url":"https://api.github.com/users/lrvick/followers","following_url":"https://api.github.com/users/lrvick/following{/other_user}","gists_url":"https://api.github.com/users/lrvick/gists{/gist_id}","starred_url":"https://api.github.com/users/lrvick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrvick/subscriptions","organizations_url":"https://api.github.com/users/lrvick/orgs","repos_url":"https://api.github.com/users/lrvick/repos","events_url":"https://api.github.com/users/lrvick/events{/privacy}","received_events_url":"https://api.github.com/users/lrvick/received_events","type":"User","site_admin":false},"assignees":[{"login":"lrvick","id":69200,"avatar_url":"https://avatars.githubusercontent.com/u/69200?v=3","gravatar_id":"","url":"https://api.github.com/users/lrvick","html_url":"https://github.com/lrvick","followers_url":"https://api.github.com/users/lrvick/followers","following_url":"https://api.github.com/users/lrvick/following{/other_user}","gists_url":"https://api.github.com/users/lrvick/gists{/gist_id}","starred_url":"https://api.github.com/users/lrvick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrvick/subscriptions","organizations_url":"https://api.github.com/users/lrvick/orgs","repos_url":"https://api.github.com/users/lrvick/repos","events_url":"https://api.github.com/users/lrvick/events{/privacy}","received_events_url":"https://api.github.com/users/lrvick/received_events","type":"User","site_admin":false},{"login":"thepwagner","id":1559510,"avatar_url":"https://avatars.githubusercontent.com/u/1559510?v=3","gravatar_id":"","url":"https://api.github.com/users/thepwagner","html_url":"https://github.com/thepwagner","followers_url":"https://api.github.com/users/thepwagner/followers","following_url":"https://api.github.com/users/thepwagner/following{/other_user}","gists_url":"https://api.github.com/users/thepwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/thepwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thepwagner/subscriptions","organizations_url":"https://api.github.com/users/thepwagner/orgs","repos_url":"https://api.github.com/users/thepwagner/repos","events_url":"https://api.github.com/users/thepwagner/events{/privacy}","received_events_url":"https://api.github.com/users/thepwagner/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pebble/git-deploy/pulls/48/commits","review_comments_url":"https://api.github.com/repos/pebble/git-deploy/pulls/48/comments","review_comment_url":"https://api.github.com/repos/pebble/git-deploy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pebble/git-deploy/issues/48/comments","statuses_url":"https://api.github.com/repos/pebble/git-deploy/statuses/ad07a0adcb175c3f8667222a0caf3779aa8743a0","head":{"label":"pebble:WEBOPS-821/hook_per_env","ref":"WEBOPS-821/hook_per_env","sha":"ad07a0adcb175c3f8667222a0caf3779aa8743a0","user":{"login":"pebble","id":1048268,"avatar_url":"https://avatars.githubusercontent.com/u/1048268?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble","html_url":"https://github.com/pebble","followers_url":"https://api.github.com/users/pebble/followers","following_url":"https://api.github.com/users/pebble/following{/other_user}","gists_url":"https://api.github.com/users/pebble/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble/subscriptions","organizations_url":"https://api.github.com/users/pebble/orgs","repos_url":"https://api.github.com/users/pebble/repos","events_url":"https://api.github.com/users/pebble/events{/privacy}","received_events_url":"https://api.github.com/users/pebble/received_events","type":"Organization","site_admin":false},"repo":{"id":32828734,"name":"git-deploy","full_name":"pebble/git-deploy","owner":{"login":"pebble","id":1048268,"avatar_url":"https://avatars.githubusercontent.com/u/1048268?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble","html_url":"https://github.com/pebble","followers_url":"https://api.github.com/users/pebble/followers","following_url":"https://api.github.com/users/pebble/following{/other_user}","gists_url":"https://api.github.com/users/pebble/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble/subscriptions","organizations_url":"https://api.github.com/users/pebble/orgs","repos_url":"https://api.github.com/users/pebble/repos","events_url":"https://api.github.com/users/pebble/events{/privacy}","received_events_url":"https://api.github.com/users/pebble/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pebble/git-deploy","description":"Git based deployment system","fork":false,"url":"https://api.github.com/repos/pebble/git-deploy","forks_url":"https://api.github.com/repos/pebble/git-deploy/forks","keys_url":"https://api.github.com/repos/pebble/git-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pebble/git-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pebble/git-deploy/teams","hooks_url":"https://api.github.com/repos/pebble/git-deploy/hooks","issue_events_url":"https://api.github.com/repos/pebble/git-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/pebble/git-deploy/events","assignees_url":"https://api.github.com/repos/pebble/git-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/pebble/git-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/pebble/git-deploy/tags","blobs_url":"https://api.github.com/repos/pebble/git-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pebble/git-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pebble/git-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pebble/git-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pebble/git-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/pebble/git-deploy/languages","stargazers_url":"https://api.github.com/repos/pebble/git-deploy/stargazers","contributors_url":"https://api.github.com/repos/pebble/git-deploy/contributors","subscribers_url":"https://api.github.com/repos/pebble/git-deploy/subscribers","subscription_url":"https://api.github.com/repos/pebble/git-deploy/subscription","commits_url":"https://api.github.com/repos/pebble/git-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pebble/git-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pebble/git-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pebble/git-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pebble/git-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/pebble/git-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pebble/git-deploy/merges","archive_url":"https://api.github.com/repos/pebble/git-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pebble/git-deploy/downloads","issues_url":"https://api.github.com/repos/pebble/git-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/pebble/git-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/pebble/git-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/pebble/git-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pebble/git-deploy/labels{/name}","releases_url":"https://api.github.com/repos/pebble/git-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/pebble/git-deploy/deployments","created_at":"2015-03-24T22:25:54Z","updated_at":"2016-07-05T16:31:06Z","pushed_at":"2016-08-11T20:22:50Z","git_url":"git://github.com/pebble/git-deploy.git","ssh_url":"git@github.com:pebble/git-deploy.git","clone_url":"https://github.com/pebble/git-deploy.git","svn_url":"https://github.com/pebble/git-deploy","homepage":null,"size":198,"stargazers_count":19,"watchers_count":19,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":19,"default_branch":"master"}},"base":{"label":"pebble:master","ref":"master","sha":"0513386e69279060fa2807daf78f69747587ae7e","user":{"login":"pebble","id":1048268,"avatar_url":"https://avatars.githubusercontent.com/u/1048268?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble","html_url":"https://github.com/pebble","followers_url":"https://api.github.com/users/pebble/followers","following_url":"https://api.github.com/users/pebble/following{/other_user}","gists_url":"https://api.github.com/users/pebble/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble/subscriptions","organizations_url":"https://api.github.com/users/pebble/orgs","repos_url":"https://api.github.com/users/pebble/repos","events_url":"https://api.github.com/users/pebble/events{/privacy}","received_events_url":"https://api.github.com/users/pebble/received_events","type":"Organization","site_admin":false},"repo":{"id":32828734,"name":"git-deploy","full_name":"pebble/git-deploy","owner":{"login":"pebble","id":1048268,"avatar_url":"https://avatars.githubusercontent.com/u/1048268?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble","html_url":"https://github.com/pebble","followers_url":"https://api.github.com/users/pebble/followers","following_url":"https://api.github.com/users/pebble/following{/other_user}","gists_url":"https://api.github.com/users/pebble/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble/subscriptions","organizations_url":"https://api.github.com/users/pebble/orgs","repos_url":"https://api.github.com/users/pebble/repos","events_url":"https://api.github.com/users/pebble/events{/privacy}","received_events_url":"https://api.github.com/users/pebble/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pebble/git-deploy","description":"Git based deployment system","fork":false,"url":"https://api.github.com/repos/pebble/git-deploy","forks_url":"https://api.github.com/repos/pebble/git-deploy/forks","keys_url":"https://api.github.com/repos/pebble/git-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pebble/git-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pebble/git-deploy/teams","hooks_url":"https://api.github.com/repos/pebble/git-deploy/hooks","issue_events_url":"https://api.github.com/repos/pebble/git-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/pebble/git-deploy/events","assignees_url":"https://api.github.com/repos/pebble/git-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/pebble/git-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/pebble/git-deploy/tags","blobs_url":"https://api.github.com/repos/pebble/git-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pebble/git-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pebble/git-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pebble/git-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pebble/git-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/pebble/git-deploy/languages","stargazers_url":"https://api.github.com/repos/pebble/git-deploy/stargazers","contributors_url":"https://api.github.com/repos/pebble/git-deploy/contributors","subscribers_url":"https://api.github.com/repos/pebble/git-deploy/subscribers","subscription_url":"https://api.github.com/repos/pebble/git-deploy/subscription","commits_url":"https://api.github.com/repos/pebble/git-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pebble/git-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pebble/git-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pebble/git-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pebble/git-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/pebble/git-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pebble/git-deploy/merges","archive_url":"https://api.github.com/repos/pebble/git-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pebble/git-deploy/downloads","issues_url":"https://api.github.com/repos/pebble/git-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/pebble/git-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/pebble/git-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/pebble/git-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pebble/git-deploy/labels{/name}","releases_url":"https://api.github.com/repos/pebble/git-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/pebble/git-deploy/deployments","created_at":"2015-03-24T22:25:54Z","updated_at":"2016-07-05T16:31:06Z","pushed_at":"2016-08-11T20:22:50Z","git_url":"git://github.com/pebble/git-deploy.git","ssh_url":"git@github.com:pebble/git-deploy.git","clone_url":"https://github.com/pebble/git-deploy.git","svn_url":"https://github.com/pebble/git-deploy","homepage":null,"size":198,"stargazers_count":19,"watchers_count":19,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pebble/git-deploy/pulls/48"},"html":{"href":"https://github.com/pebble/git-deploy/pull/48"},"issue":{"href":"https://api.github.com/repos/pebble/git-deploy/issues/48"},"comments":{"href":"https://api.github.com/repos/pebble/git-deploy/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/pebble/git-deploy/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/pebble/git-deploy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pebble/git-deploy/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/pebble/git-deploy/statuses/ad07a0adcb175c3f8667222a0caf3779aa8743a0"}}}}
{"actor":{"display_login":"thepwagner"}}