History

doc.fetch: read GITHUB_TOKEN also from ENV

Simon Legner committed 6 years ago

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

Showing the changes to lib (1 of 1 file). Show all

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}")

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t