GithubLatest: Use API URL as generated value

The generated URL should reflect what we're actually checking, which
is now the `/releases/latest` API URL.
This commit is contained in:
Sam Ford 2023-05-04 11:17:24 -04:00 committed by Sean Molenaar
parent 34e2779150
commit cfba45fb56
No known key found for this signature in database
GPG Key ID: AAC1C7E1A4696A9A
2 changed files with 2 additions and 3 deletions

View File

@ -76,8 +76,7 @@ module Homebrew
match = url.sub(/\.git$/i, "").match(URL_MATCH_REGEX) match = url.sub(/\.git$/i, "").match(URL_MATCH_REGEX)
return values if match.blank? return values if match.blank?
# Example URL: `https://github.com/example/example/releases/latest` values[:url] = "https://api.github.com/repos/#{match[:username]}/#{match[:repository]}/releases/latest"
values[:url] = "https://github.com/#{match[:username]}/#{match[:repository]}/releases/latest"
values[:username] = match[:username] values[:username] = match[:username]
values[:repository] = match[:repository] values[:repository] = match[:repository]

View File

@ -16,8 +16,8 @@ describe Homebrew::Livecheck::Strategy::GithubLatest do
let(:generated) do let(:generated) do
{ {
url: "https://api.github.com/repos/abc/def/releases/latest",
username: "abc", username: "abc",
url: "https://github.com/abc/def/releases/latest",
repository: "def", repository: "def",
} }
end end