{"action":"opened","issue":{"url":"https://api.github.com/repos/WCOMAB/Cake_Git/issues/9","repository_url":"https://api.github.com/repos/WCOMAB/Cake_Git","labels_url":"https://api.github.com/repos/WCOMAB/Cake_Git/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/WCOMAB/Cake_Git/issues/9/comments","events_url":"https://api.github.com/repos/WCOMAB/Cake_Git/issues/9/events","html_url":"https://github.com/WCOMAB/Cake_Git/issues/9","id":169627153,"number":9,"title":"Add alias for git push with refspec","user":{"login":"jblazek","id":5160184,"avatar_url":"https://avatars.githubusercontent.com/u/5160184?v=3","gravatar_id":"","url":"https://api.github.com/users/jblazek","html_url":"https://github.com/jblazek","followers_url":"https://api.github.com/users/jblazek/followers","following_url":"https://api.github.com/users/jblazek/following{/other_user}","gists_url":"https://api.github.com/users/jblazek/gists{/gist_id}","starred_url":"https://api.github.com/users/jblazek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jblazek/subscriptions","organizations_url":"https://api.github.com/users/jblazek/orgs","repos_url":"https://api.github.com/users/jblazek/repos","events_url":"https://api.github.com/users/jblazek/events{/privacy}","received_events_url":"https://api.github.com/users/jblazek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-05T15:01:52Z","updated_at":"2016-08-05T15:01:52Z","closed_at":null,"body":"As part of our build workflow, we push a tag to a remote.  Currently, it seems like the Cake.Git only supports pushing branches.  \r\n\r\nThe helper code I wrote to do this looks like the following \r\n```cs\r\nstatic class GitExt {\r\n\tpublic static void Push(DirectoryPath repositoryPath, string remote, string refSpec) {\r\n\t\tusing (var repository = new LibGit2Sharp.Repository(repositoryPath.FullPath))\r\n\t\t{\r\n\t\t\trepository.Network.Push(repository.Network.Remotes[remote], refSpec);\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nThe cake build task I use then calls the helper code like below:\r\n```cs\r\nTask(\"Push-Release-Tag\")\r\n\t.WithCriteria(isReleaseRequested)\r\n\t.WithCriteria(!noPush)\r\n\t.Does(() => {\r\n\t\tvar tagVersion = \"v\" + releaseVersion;\r\n\t\tstring gitRemote = \"origin\";\r\n\t\tInformation(\"Pushing new tag to {0}\", gitRemote);\r\n\t\tGitExt.Push(\".\", gitRemote, \"refs/tags/\" + tagVersion);\r\n\t});\r\n```\r\n\r\nThis seems like the type of thing that would be useful to include with the Cake.Addin, would this be something that could be added?\r\n"}}
{"actor":{"display_login":"jblazek"}}