We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a87b81 commit 61d15c0Copy full SHA for 61d15c0
models/github_repo.cr
@@ -39,12 +39,19 @@ class GithubRepo
39
headers = HTTP::Headers.new
40
headers["User-Agent"] = "crystalshards"
41
response = client.get("/repos/#{full_name}/releases", headers)
42
- p "pulling..."
+ p "pulling release of #{full_name}..."
43
releases = JSON.parse(response.body)
44
if releases.size > 0
45
releases[0]["tag_name"].to_s
46
else
47
- ""
+ response = client.get("/repos/#{full_name}/tags", headers)
48
+ p "release not found, pulling tag of #{full_name}..."
49
+ tags = JSON.parse(response.body)
50
+ if tags.size > 0
51
+ tags[0]["name"].to_s
52
+ else
53
+ ""
54
+ end
55
end
56
57
0 commit comments