We have a few scripts that automate a lot of our workflow, and currently it uses hub
a bit. One thing I want to be able to do is automatically add a comment to an issue like “This issue is being worked starting from sellout/slamdata@123764327412736.” when the first push to the branch named “wip/264-some-issue” happens.
In the future the Go implementation of hub might allow issue management as
well as adding of comments.
Is there any idea how would you like such a command to look like?
I hadn’t really thought about how it would look, but maybe something like this: hub comment SHA/ISSUE-REF [-o|--browse] [-m MESSAGE|-F FILE]
So, any SHA or issue ref that would work in Markdown would work as a comment destination. The other options are the same as pull-request
(including falling back to $EDITOR
).
This is something that https://github.com/stephencelis/ghi does quite well, at the moment. Just a suggestion.
@RichardLitt Ah, excellent. I’ll give that a go. Thanks!
After some consideration, I have decided that—for now—this is best implemented in user scripts, rather than maintained in hub core. Now that there is a new hub api
command, I will close this feature request and leave implementing this as an exercise to the reader. https://github.com/github/hub/releases/tag/v2.8.3 https://github.com/github/hub/pull/2016
For example:
hub api repos/{owner}/{repo}/issues/1234/comments -f body='This is my comment!'
Thank you for suggesting!
Most helpful comment
After some consideration, I have decided that—for now—this is best implemented in user scripts, rather than maintained in hub core. Now that there is a new
hub api
command, I will close this feature request and leave implementing this as an exercise to the reader. https://github.com/github/hub/releases/tag/v2.8.3 https://github.com/github/hub/pull/2016For example:
Thank you for suggesting!