mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
@@ -67,6 +67,15 @@ class AttemptProjectRepoMappingJob < ApplicationJob
|
||||
.get("https://api.github.com/users/#{@user.github_username}/orgs")
|
||||
|
||||
Rails.logger.info "GitHub orgs response: #{response.body}"
|
||||
JSON.parse(response.body)
|
||||
|
||||
return [] unless response.status.success?
|
||||
|
||||
parsed_response = JSON.parse(response.body)
|
||||
return [] unless parsed_response.is_a?(Array)
|
||||
|
||||
parsed_response
|
||||
rescue JSON::ParserError => e
|
||||
Rails.logger.error "Failed to parse GitHub orgs response: #{e.message}"
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user