github-commits: Add HUBOT_GITIO and HUBOT_COMMIT_ONELINE#1461
github-commits: Add HUBOT_GITIO and HUBOT_COMMIT_ONELINE#1461wking wants to merge 2 commits intogithub:masterfrom
Conversation
Short URLs are nice, but when I don't have a browser running, I prefer something with the unadulterated commit hash. With the new envorinment variable, you can turn Git.io shortening on or off as you see fit. The alternative URL manipulation and HUBOT_GITHUB_API docs come from github-commit-link.coffee.
Following 660ae28 (github-commit-link: Only show the first line of the commit, 2014-03-13), but configurable this time, for folks who push tiny feature branches and *do* actually want the whole message dumped into their channel.
There was a problem hiding this comment.
This is done asynchronously, so if you set process.env.HUBOT_GITIO, this updated commit.url isn't ensured to be set by the time robot.send is called.
To get around that, I'd suggest refactoring most of the logic to it's own function, so it can either be called in a callback for gitio if process.env.HUBOT_GITIO or by itself.
There was a problem hiding this comment.
On Sat, May 24, 2014 at 07:51:09AM -0700, Josh Nichols wrote:
To get around that, I'd suggest refactoring most of the logic to
it's own function, …
I've pulled this out into githubot with iangreenleaf/githubot#25.
Once that lands and is released, I'll update this PR with the
associated githubot bumps and API changes.
|
We are actually moving away from adding scripts to repository in favor of separate npm packages per scripts. We have already stopped accepting new scripts, and will stop accepting pull requests on this repository after hubot 3.0. See #1113 for details. If you are interested in maintaining this longer term, check npm in case someone already made a package for it, and if not, check out https://hubot.github.com/docs/scripting/ for creating a package of your own. cc @Nesquick @spajus @adomokos @hashashin @christhomson @wking @canadianveggie as previous contributors to this script. Also, a quick npm search shows a number of scripts that might fill a similar role: https://www.npmjs.com/search?q=hubot+github |
Details and motivation in the commit messages.