feat: change api tags url for github
This commit is contained in:
parent
a36060eb84
commit
d4e44332ea
1 changed files with 4 additions and 6 deletions
|
@ -26,24 +26,22 @@ namespace :repositories do
|
||||||
tags =
|
tags =
|
||||||
JSON.parse(
|
JSON.parse(
|
||||||
get_url_content(
|
get_url_content(
|
||||||
"https://api.github.com/repos/#{repo.name}/git/refs/tags",
|
"https://api.github.com/repos/#{repo.name}/tags",
|
||||||
headers
|
headers
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
tags.each do |tag|
|
tags.each do |tag|
|
||||||
version = tag['ref'].split('/').last
|
next if versions.include?(tag['name'])
|
||||||
next if versions.include?(version)
|
|
||||||
puts version
|
|
||||||
|
|
||||||
date =
|
date =
|
||||||
JSON.parse(
|
JSON.parse(
|
||||||
get_url_content(tag['object']['url'], headers)
|
get_url_content(tag['commit']['url'], headers)
|
||||||
)['committer']['date']
|
)['committer']['date']
|
||||||
|
|
||||||
Version.new(
|
Version.new(
|
||||||
software_id: software.id,
|
software_id: software.id,
|
||||||
number: version,
|
number: tag['name'],
|
||||||
date: date
|
date: date
|
||||||
).save
|
).save
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue