From d4e44332ea0f891035ea71e15fbb7bdd1b85a9d6 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Sat, 4 Aug 2018 08:00:12 +0200 Subject: [PATCH] feat: change api tags url for github --- lib/tasks/repositories.rake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/tasks/repositories.rake b/lib/tasks/repositories.rake index 0c132e1..b0a1c8c 100644 --- a/lib/tasks/repositories.rake +++ b/lib/tasks/repositories.rake @@ -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