@@ -58,7 +58,7 @@ You can listen for the event and use as much of the data as you want.
58
58
59
59
If you want hubot to write to your chat room a message like this:
60
60
61
- > hubot: [ repo_owner/repo] <link| #sha> commit message
61
+ > hubot: [ repo_owner/repo] <#sha|link > commit message
62
62
> commit description
63
63
> - commit author
64
64
@@ -79,6 +79,7 @@ Add `["hubot-bitbucket-commit"]` to `hubot-scripts.json` (or whatever you want)
79
79
# GabLeRoux
80
80
#
81
81
82
+ # https://github.com/slackhq/hubot-slack/issues/114 wtf slack...
82
83
module .exports = (robot ) ->
83
84
bitbucketPushEvent = process .env .HUBOT_BITBUCKET_PUSH_EVENT or ' bitbucketPushReceived'
84
85
room = process .env .HUBOT_BITBUCKET_PUSH_ROOM or ' general'
@@ -89,6 +90,8 @@ module.exports = (robot) ->
89
90
repo_url = res .repository .links .html .href
90
91
commits_url = res .push .changes [0 ].links .html .href
91
92
93
+ response = " [#{ repo_name} ] #{ repo_url} \n "
94
+
92
95
commit = res .push .changes [0 ].new
93
96
new_commit_author_username = commit .target .author .user .username
94
97
new_commit_author_display_name = commit .target .author .user .display_name
@@ -101,11 +104,11 @@ module.exports = (robot) ->
101
104
new_commit_name = commit .name
102
105
new_commit_on = new_commit_type + " " + new_commit_name
103
106
104
- response = " <#{ repo_url} |[#{ repo_name} ]>\n "
105
107
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
+
109
112
robot .messageRoom room, response
110
113
111
114
return
@@ -114,9 +117,10 @@ module.exports = (robot) ->
114
117
115
118
It should display something like this:
116
119
```
117
- < https://bitbucket.org/gableroux/some-repository|[gableroux/some-repository]>
120
+ [gableroux/some-repository] https://bitbucket.org/gableroux/some-repository
118
121
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
120
124
121
125
* Support for multiline commit message
122
126
* Some other content in commit message, etc.
0 commit comments