Merge pull request #1178 from simon04/env-github-token

doc.fetch: read GITHUB_TOKEN also from ENV
pull/1307/head
Jasper van Merle 4 years ago committed by GitHub
commit e7955ccadb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -220,6 +220,8 @@ module Docs
if opts.key?(:github_token) and url.start_with?('https://api.github.com/') if opts.key?(:github_token) and url.start_with?('https://api.github.com/')
headers['Authorization'] = "token #{opts[:github_token]}" headers['Authorization'] = "token #{opts[:github_token]}"
elsif ENV['GITHUB_TOKEN'] and url.start_with?('https://api.github.com/')
headers['Authorization'] = "token #{ENV['GITHUB_TOKEN']}"
end end
opts[:logger].debug("Fetching #{url}") opts[:logger].debug("Fetching #{url}")

Loading…
Cancel
Save