History

doc.fetch: read GITHUB_TOKEN also from ENV

Simon Legner committed 6 years ago

Commit c25fbb41 parent 40df5211 file · +2 −0Browse files

Unified · Split

lib/docs/core/doc.rb+2−0
@@ -220,6 +220,8 @@ module Docs · 219 unmodified lines
220 220
221 if opts.key?(:github_token) and url.start_with?('https://api.github.com/')221 if opts.key?(:github_token) and url.start_with?('https://api.github.com/')
222 headers['Authorization'] = "token #{opts[:github_token]}"222 headers['Authorization'] = "token #{opts[:github_token]}"
223 elsif ENV['GITHUB_TOKEN'] and url.start_with?('https://api.github.com/')
224 headers['Authorization'] = "token #{ENV['GITHUB_TOKEN']}"
223 end225 end
224 226
225 opts[:logger].debug("Fetching #{url}")227 opts[:logger].debug("Fetching #{url}")