Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

The new URL/key that Slack is (re)generating for incoming webhooks appears to need an update. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chef-handler-slack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)

Gem::Specification.new do |s|
s.name = "chef-handler-slack"
s.version = "0.1.0"
s.version = "0.1.1"
s.authors = ["Derek Smith"]
s.email = ["[email protected]"]
s.homepage = "https://github.com/tinyspeck/chef-handler-slack"
Expand Down
7 changes: 6 additions & 1 deletion lib/chef/handler/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def send(msg)
:token => @token,
}

uri = URI("https://#{@team}.slack.com/services/hooks/incoming-webhook?token=#{@token}")
if token.include? "/"
uri = URI("https://hooks.slack.com/services/#{@token}")
else
uri = URI("https://#{@team}.slack.com/services/hooks/incoming-webhook?token=#{@token}")
end

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

Expand Down