Fix bug with wrong credentials in 1.0.1 (fixed #12)

This commit is contained in:
Petr Korolev 2014-11-10 14:40:10 +02:00
parent a33b52d6d0
commit 936b191566

View File

@ -117,9 +117,14 @@ class ChangelogGenerator
puts "Receive tags for repo #{url}"
end
response = HTTParty.get(url,
:headers => {'Authorization' => "token #{@options[:token]}",
'User-Agent' => 'Changelog-Generator'})
if @options[:token]
response = HTTParty.get(url,
:headers => {'Authorization' => "token #{@options[:token]}",
'User-Agent' => 'Changelog-Generator'})
else
response = HTTParty.get(url,
:headers => {'User-Agent' => 'Changelog-Generator'})
end
json_parse = JSON.parse(response.body)