Created
February 26, 2020 15:15
-
-
Save ryot4/6642a7a6b92601f83c2000bf94f9b3c2 to your computer and use it in GitHub Desktop.
Get the number of downloads for each release asset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'octokit' | |
client = Octokit::Client.new(:access_token => '<personal_access_token>') | |
client.releases('<user>/<repo>').each do |rel| | |
puts rel.name | |
client.release_assets(rel.url).each do |asset| | |
puts "#{asset.name} #{asset.download_count}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment