Fix Style/FetchEnvVar
cop in repo.rake
(#34903)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
a80f77a996
commit
e2c5a2abaa
2 changed files with 1 additions and 2 deletions
|
@ -33,7 +33,6 @@ Style/FetchEnvVar:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'config/initializers/2_limited_federation_mode.rb'
|
- 'config/initializers/2_limited_federation_mode.rb'
|
||||||
- 'config/initializers/paperclip.rb'
|
- 'config/initializers/paperclip.rb'
|
||||||
- 'lib/tasks/repo.rake'
|
|
||||||
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
# This cop supports safe autocorrection (--autocorrect).
|
||||||
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace :repo do
|
||||||
response = nil
|
response = nil
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
response = HTTP.headers('Authorization' => "token #{ENV['GITHUB_API_TOKEN']}").get("https://api.github.com/repos/#{REPOSITORY_NAME}/pulls/#{pull_request_number}")
|
response = HTTP.headers('Authorization' => "token #{ENV.fetch('GITHUB_API_TOKEN')}").get("https://api.github.com/repos/#{REPOSITORY_NAME}/pulls/#{pull_request_number}")
|
||||||
|
|
||||||
if response.code == 403
|
if response.code == 403
|
||||||
sleep_for = (response.headers['X-RateLimit-Reset'].to_i - Time.now.to_i).abs
|
sleep_for = (response.headers['X-RateLimit-Reset'].to_i - Time.now.to_i).abs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue