Skip to content

Instantly share code, notes, and snippets.

@ryot4
Created February 26, 2020 15:15
Show Gist options
  • Save ryot4/6642a7a6b92601f83c2000bf94f9b3c2 to your computer and use it in GitHub Desktop.
Save ryot4/6642a7a6b92601f83c2000bf94f9b3c2 to your computer and use it in GitHub Desktop.
Get the number of downloads for each release asset
#!/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