Skip to content

Commit 2ac813a

Browse files
committed
update README.md
1 parent 1c53564 commit 2ac813a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ Notify Slack's channel about recent push:
118118
> EOF
119119
```
120120
```
121-
~ $ webhook -secret secret123 slack.tsc
121+
~ $ SLACK_TOKEN=token SLACK_CHANNEL=channel123 webhook -secret secret123 slack.tsc
122122
```
123123
Notify HipChat's room about recent push:
124124
```bash
125-
~ $ cat >hipchat.tsc <<EOF
125+
~ $ cat >hipchat.tsc <<EOF
126126
> {{with $e := .}}
127-
> {{if eq $e.name "push"}}
128-
> {{with $auth := (printf "authorization: bearer %s" (env "hipchat_token"))}}
129-
> {{with $msg := (printf "{\"message_format\": \"text\", \"message\": \"%s pushed to %s\"}" $e.payload.pusher.email $e.payload.repository.name)}}
130-
> {{with $url := (printf "https://api.hipchat.com/v2/room/%s/notification" (env "hipchat_room"))}}
127+
> {{if eq $e.Name "push"}}
128+
> {{with $auth := (printf "authorization: bearer %s" (env "HIPCHAT_TOKEN"))}}
129+
> {{with $msg := (printf "{\"message_format\": \"text\", \"message\": \"%s pushed to %s\"}" $e.Payload.Pusher.Email $e.Payload.Repository.Name)}}
130+
> {{with $url := (printf "https://api.hipchat.com/v2/room/%s/notification" (env "HIPCHAT_ROOM"))}}
131131
> {{exec "curl" "-h" "content-type: application/json" "-h" $auth "-x" "post" "-d" $msg $url | log}}
132132
> {{end}}
133133
> {{end}}
@@ -137,7 +137,7 @@ Notify HipChat's room about recent push:
137137
> EOF
138138
```
139139
```
140-
~ $ webhook -secret secret123 hipchat.tsc
140+
~ $ HIPCHAT_TOKEN=token HIPCHAT_ROOM=123 webhook -secret secret123 hipchat.tsc
141141
```
142142
143143
### Troubleshooting

0 commit comments

Comments
 (0)