Skip to content

Commit 454463f

Browse files
committed
Revert "Fix from slackapi/hubot-slack#114 woot"
This reverts commit ef253ea.
1 parent ef253ea commit 454463f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ You can listen for the event and use as much of the data as you want.
5858

5959
If you want hubot to write to your chat room a message like this:
6060

61-
> hubot: [repo_owner/repo] <link|#sha> commit message
61+
> hubot: [repo_owner/repo] <#sha|link> commit message
6262
> commit description
6363
> - commit author
6464
@@ -79,6 +79,7 @@ Add `["hubot-bitbucket-commit"]` to `hubot-scripts.json` (or whatever you want)
7979
# GabLeRoux
8080
#
8181

82+
# https://github.com/slackhq/hubot-slack/issues/114 wtf slack...
8283
module.exports = (robot) ->
8384
bitbucketPushEvent = process.env.HUBOT_BITBUCKET_PUSH_EVENT or 'bitbucketPushReceived'
8485
room = process.env.HUBOT_BITBUCKET_PUSH_ROOM or 'general'
@@ -89,6 +90,8 @@ module.exports = (robot) ->
8990
repo_url = res.repository.links.html.href
9091
commits_url = res.push.changes[0].links.html.href
9192

93+
response = "[#{repo_name}] #{repo_url}\n"
94+
9295
commit = res.push.changes[0].new
9396
new_commit_author_username = commit.target.author.user.username
9497
new_commit_author_display_name = commit.target.author.user.display_name
@@ -101,11 +104,11 @@ module.exports = (robot) ->
101104
new_commit_name = commit.name
102105
new_commit_on = new_commit_type + " " + new_commit_name
103106

104-
response = "<#{repo_url}|[#{repo_name}]>\n"
105107
response += "New commit(s) on #{new_commit_on}\n"
106-
response += "<#{commits_url}|#{new_commit_hash_short}> #{new_commit_message}\n"
107-
response += " - <#{new_commit_author_url}|#{new_commit_author_display_name} (#{new_commit_author_username})>\n"
108-
108+
response += "#{commits_url}\n"
109+
response += "#{new_commit_hash_short} #{new_commit_message}\n"
110+
response += " - #{new_commit_author_display_name} (#{new_commit_author_username})\n"
111+
109112
robot.messageRoom room, response
110113

111114
return
@@ -114,9 +117,10 @@ module.exports = (robot) ->
114117

115118
It should display something like this:
116119
```
117-
<https://bitbucket.org/gableroux/some-repository|[gableroux/some-repository]>
120+
[gableroux/some-repository] https://bitbucket.org/gableroux/some-repository
118121
New commit(s) on branch master
119-
<https://bitbucket.org/gableroux/some-repository/branches/compare/2ad9d60ef4f9369c5668c9dd9e3798c91e4f30cd..14c2888e3c6678d26c1b65c9f45cd5bad79b8370|2ad9d60> Some commit message
122+
https://bitbucket.org/gableroux/some-repository/branches/compare/2ad9d60ef4f9369c5668c9dd9e3798c91e4f30cd..14c2888e3c6678d26c1b65c9f45cd5bad79b8370
123+
2ad9d60 Some commit message
120124
121125
* Support for multiline commit message
122126
* Some other content in commit message, etc.

0 commit comments

Comments
 (0)