Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Feb 26, 2025
1 parent e5edfbb commit ad6a7b7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions bin/check_prebuilt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class RuntimeBuilder
PLATFORMS = PrebuiltMatrix::PLATFORMS

def initialize(version, force_rebuild = false)
@client = Octokit::Client.new
@client = if ENV["GITHUB_TOKEN"]
Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"])
else
Octokit::Client.new
end
@force_rebuild = force_rebuild
@tebako_version = version
end
Expand All @@ -47,8 +51,14 @@ def find_release_info(filename)
return { "url" => asset.browser_download_url } if asset
end
nil
rescue Octokit::NotFound
warn "Warning: Repository #{RUNTIME_REPO} not found or no access"
rescue Octokit::Unauthorized
warn "Warning: Invalid GitHub token or no access to #{RUNTIME_REPO}"
nil
rescue Octokit::TooManyRequests
warn "Warning: GitHub API rate limit exceeded"
nil
rescue Octokit::Error => e
warn "Warning: GitHub API error: #{e.message}"
nil
end

Expand Down

0 comments on commit ad6a7b7

Please sign in to comment.