{"action":"created","comment":{"url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/comments/73642411","id":73642411,"diff_hunk":"@@ -22,3 +23,37 @@ func Clone(repo, destination string) error {\n \t}\n \treturn nil\n }\n+\n+// Fetch fetches a pull request into a branch named \"_pr\"\n+func Fetch(prNumber string) error {\n+\tcmd := execCommand(\"git\", \"fetch\", \"origin\", \"pull/\"+prNumber+\"/head:_pr\")\n+\tcmd.Stdout = os.Stdout\n+\n+\terr := cmd.Start()\n+\tif err != nil {\n+\t\treturn fmt.Errorf(\"starting git fet command: %v\", err)\n+\t}\n+\n+\terr = cmd.Wait()\n+\tif err != nil {\n+\t\treturn fmt.Errorf(\"Fetching pull request: %v\", err)\n+\t}\n+\treturn nil\n+}\n+\n+// Merge merges changes on the \"_pr\" branch\n+func Merge() error {\n+\tcmd := execCommand(\"git\", \"merge\", \"_pr\")","path":"git/git.go","position":32,"original_position":32,"commit_id":"7b26e47ca88387589af722ff2e28ed841735fef5","original_commit_id":"7b26e47ca88387589af722ff2e28ed841735fef5","user":{"login":"jer","id":48668,"avatar_url":"https://avatars.githubusercontent.com/u/48668?v=3","gravatar_id":"","url":"https://api.github.com/users/jer","html_url":"https://github.com/jer","followers_url":"https://api.github.com/users/jer/followers","following_url":"https://api.github.com/users/jer/following{/other_user}","gists_url":"https://api.github.com/users/jer/gists{/gist_id}","starred_url":"https://api.github.com/users/jer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jer/subscriptions","organizations_url":"https://api.github.com/users/jer/orgs","repos_url":"https://api.github.com/users/jer/repos","events_url":"https://api.github.com/users/jer/events{/privacy}","received_events_url":"https://api.github.com/users/jer/received_events","type":"User","site_admin":false},"body":"I think it's fine to have separate functions, but I wouldn't object to a function that combines things like MergePR or something","created_at":"2016-08-05T05:06:12Z","updated_at":"2016-08-05T05:06:12Z","html_url":"https://github.com/screwdriver-cd/launcher/pull/26#discussion_r73642411","pull_request_url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/comments/73642411"},"html":{"href":"https://github.com/screwdriver-cd/launcher/pull/26#discussion_r73642411"},"pull_request":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26","id":80165811,"html_url":"https://github.com/screwdriver-cd/launcher/pull/26","diff_url":"https://github.com/screwdriver-cd/launcher/pull/26.diff","patch_url":"https://github.com/screwdriver-cd/launcher/pull/26.patch","issue_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues/26","number":26,"state":"open","locked":false,"title":"Add checkIfPR, Fetch, and Merge functions","user":{"login":"Filbird","id":11892496,"avatar_url":"https://avatars.githubusercontent.com/u/11892496?v=3","gravatar_id":"","url":"https://api.github.com/users/Filbird","html_url":"https://github.com/Filbird","followers_url":"https://api.github.com/users/Filbird/followers","following_url":"https://api.github.com/users/Filbird/following{/other_user}","gists_url":"https://api.github.com/users/Filbird/gists{/gist_id}","starred_url":"https://api.github.com/users/Filbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Filbird/subscriptions","organizations_url":"https://api.github.com/users/Filbird/orgs","repos_url":"https://api.github.com/users/Filbird/repos","events_url":"https://api.github.com/users/Filbird/events{/privacy}","received_events_url":"https://api.github.com/users/Filbird/received_events","type":"User","site_admin":false},"body":"Adds functionality for checking if job name is a PR, then fetching and merging if so.","created_at":"2016-08-04T23:20:30Z","updated_at":"2016-08-05T05:06:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c63032356051a64a2b1dbd724e194f6ab4137ae9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26/commits","review_comments_url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26/comments","review_comment_url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues/26/comments","statuses_url":"https://api.github.com/repos/screwdriver-cd/launcher/statuses/7b26e47ca88387589af722ff2e28ed841735fef5","head":{"label":"screwdriver-cd:mergePR","ref":"mergePR","sha":"7b26e47ca88387589af722ff2e28ed841735fef5","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":63980841,"name":"launcher","full_name":"screwdriver-cd/launcher","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/launcher","description":"The entrypoint for job launching in Screwdriver.","fork":false,"url":"https://api.github.com/repos/screwdriver-cd/launcher","forks_url":"https://api.github.com/repos/screwdriver-cd/launcher/forks","keys_url":"https://api.github.com/repos/screwdriver-cd/launcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/screwdriver-cd/launcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/screwdriver-cd/launcher/teams","hooks_url":"https://api.github.com/repos/screwdriver-cd/launcher/hooks","issue_events_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues/events{/number}","events_url":"https://api.github.com/repos/screwdriver-cd/launcher/events","assignees_url":"https://api.github.com/repos/screwdriver-cd/launcher/assignees{/user}","branches_url":"https://api.github.com/repos/screwdriver-cd/launcher/branches{/branch}","tags_url":"https://api.github.com/repos/screwdriver-cd/launcher/tags","blobs_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/screwdriver-cd/launcher/statuses/{sha}","languages_url":"https://api.github.com/repos/screwdriver-cd/launcher/languages","stargazers_url":"https://api.github.com/repos/screwdriver-cd/launcher/stargazers","contributors_url":"https://api.github.com/repos/screwdriver-cd/launcher/contributors","subscribers_url":"https://api.github.com/repos/screwdriver-cd/launcher/subscribers","subscription_url":"https://api.github.com/repos/screwdriver-cd/launcher/subscription","commits_url":"https://api.github.com/repos/screwdriver-cd/launcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/screwdriver-cd/launcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/screwdriver-cd/launcher/contents/{+path}","compare_url":"https://api.github.com/repos/screwdriver-cd/launcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/screwdriver-cd/launcher/merges","archive_url":"https://api.github.com/repos/screwdriver-cd/launcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/screwdriver-cd/launcher/downloads","issues_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues{/number}","pulls_url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls{/number}","milestones_url":"https://api.github.com/repos/screwdriver-cd/launcher/milestones{/number}","notifications_url":"https://api.github.com/repos/screwdriver-cd/launcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/screwdriver-cd/launcher/labels{/name}","releases_url":"https://api.github.com/repos/screwdriver-cd/launcher/releases{/id}","deployments_url":"https://api.github.com/repos/screwdriver-cd/launcher/deployments","created_at":"2016-07-22T20:18:23Z","updated_at":"2016-07-22T20:40:22Z","pushed_at":"2016-08-04T23:20:30Z","git_url":"git://github.com/screwdriver-cd/launcher.git","ssh_url":"git@github.com:screwdriver-cd/launcher.git","clone_url":"https://github.com/screwdriver-cd/launcher.git","svn_url":"https://github.com/screwdriver-cd/launcher","homepage":null,"size":41,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"screwdriver-cd:master","ref":"master","sha":"47a4ccec5351256ed25f7dc143d9a2ca8b5d0d84","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":63980841,"name":"launcher","full_name":"screwdriver-cd/launcher","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/launcher","description":"The entrypoint for job launching in Screwdriver.","fork":false,"url":"https://api.github.com/repos/screwdriver-cd/launcher","forks_url":"https://api.github.com/repos/screwdriver-cd/launcher/forks","keys_url":"https://api.github.com/repos/screwdriver-cd/launcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/screwdriver-cd/launcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/screwdriver-cd/launcher/teams","hooks_url":"https://api.github.com/repos/screwdriver-cd/launcher/hooks","issue_events_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues/events{/number}","events_url":"https://api.github.com/repos/screwdriver-cd/launcher/events","assignees_url":"https://api.github.com/repos/screwdriver-cd/launcher/assignees{/user}","branches_url":"https://api.github.com/repos/screwdriver-cd/launcher/branches{/branch}","tags_url":"https://api.github.com/repos/screwdriver-cd/launcher/tags","blobs_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/screwdriver-cd/launcher/statuses/{sha}","languages_url":"https://api.github.com/repos/screwdriver-cd/launcher/languages","stargazers_url":"https://api.github.com/repos/screwdriver-cd/launcher/stargazers","contributors_url":"https://api.github.com/repos/screwdriver-cd/launcher/contributors","subscribers_url":"https://api.github.com/repos/screwdriver-cd/launcher/subscribers","subscription_url":"https://api.github.com/repos/screwdriver-cd/launcher/subscription","commits_url":"https://api.github.com/repos/screwdriver-cd/launcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/screwdriver-cd/launcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/screwdriver-cd/launcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/screwdriver-cd/launcher/contents/{+path}","compare_url":"https://api.github.com/repos/screwdriver-cd/launcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/screwdriver-cd/launcher/merges","archive_url":"https://api.github.com/repos/screwdriver-cd/launcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/screwdriver-cd/launcher/downloads","issues_url":"https://api.github.com/repos/screwdriver-cd/launcher/issues{/number}","pulls_url":"https://api.github.com/repos/screwdriver-cd/launcher/pulls{/number}","milestones_url":"https://api.github.com/repos/screwdriver-cd/launcher/milestones{/number}","notifications_url":"https://api.github.com/repos/screwdriver-cd/launcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/screwdriver-cd/launcher/labels{/name}","releases_url":"https://api.github.com/repos/screwdriver-cd/launcher/releases{/id}","deployments_url":"https://api.github.com/repos/screwdriver-cd/launcher/deployments","created_at":"2016-07-22T20:18:23Z","updated_at":"2016-07-22T20:40:22Z","pushed_at":"2016-08-04T23:20:30Z","git_url":"git://github.com/screwdriver-cd/launcher.git","ssh_url":"git@github.com:screwdriver-cd/launcher.git","clone_url":"https://github.com/screwdriver-cd/launcher.git","svn_url":"https://github.com/screwdriver-cd/launcher","homepage":null,"size":41,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26"},"html":{"href":"https://github.com/screwdriver-cd/launcher/pull/26"},"issue":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/issues/26"},"comments":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/screwdriver-cd/launcher/statuses/7b26e47ca88387589af722ff2e28ed841735fef5"}}}}
{"actor":{"display_login":"jer"}}