diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a4cf131691..641a7ec69a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -33,7 +33,6 @@ Style/FetchEnvVar: Exclude: - 'config/initializers/2_limited_federation_mode.rb' - 'config/initializers/paperclip.rb' - - 'lib/tasks/repo.rake' # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. diff --git a/lib/tasks/repo.rake b/lib/tasks/repo.rake index c8f977f651..6c696a9097 100644 --- a/lib/tasks/repo.rake +++ b/lib/tasks/repo.rake @@ -57,7 +57,7 @@ namespace :repo do response = nil 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 sleep_for = (response.headers['X-RateLimit-Reset'].to_i - Time.now.to_i).abs