forked from juliosueiras/vim-terraform-completion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_provider_md.rb
More file actions
26 lines (23 loc) · 834 Bytes
/
update_provider_md.rb
File metadata and controls
26 lines (23 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'open-uri'
require 'rest-client'
require 'json'
tags_urls = File.read("tags_urls.txt").split.map {|i| i.gsub('"','') }
result = []
tags_urls.each do |tags_url|
tags = JSON.parse(RestClient.get("#{tags_url}?access_token=#{ENV['GITHUB_TOKEN']}"))
if not tags.empty?
version = tags[0]["name"]
provider = tags[0]["zipball_url"].split("/")[5].match(/terraform-provider-(.*)/)[1]
result.push({ version: version, provider: provider })
end
end
final = "||||||\n|---|---|---|---|---|"
result.each_slice(5) do |i|
result = "\n|"
i.each do |c|
link = "https://img.shields.io/badge/style-#{c[:version]}-blue.svg?style=for-the-badge&label=#{c[:provider]}"
result += "[](https://github.com/terraform-providers/terraform-provider-#{c[:provider]}/blob/master/CHANGELOG.md)|"
end
final += result
end
puts final