feat: change api tags url for github

This commit is contained in:
Adrien Waksberg 2018-08-04 08:00:12 +02:00
parent a36060eb84
commit d4e44332ea

View file

@ -26,24 +26,22 @@ namespace :repositories do
tags =
JSON.parse(
get_url_content(
"https://api.github.com/repos/#{repo.name}/git/refs/tags",
"https://api.github.com/repos/#{repo.name}/tags",
headers
)
)
tags.each do |tag|
version = tag['ref'].split('/').last
next if versions.include?(version)
puts version
next if versions.include?(tag['name'])
date =
JSON.parse(
get_url_content(tag['object']['url'], headers)
get_url_content(tag['commit']['url'], headers)
)['committer']['date']
Version.new(
software_id: software.id,
number: version,
number: tag['name'],
date: date
).save
end