Unified · Split
| @@ -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 | end | 225 | end |
| 224 | 226 | ||
| 225 | opts[:logger].debug("Fetching #{url}") | 227 | opts[:logger].debug("Fetching #{url}") |