Fix Style/FetchEnvVar cop in repo.rake (#34903)
				
					
				
			Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
		@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user