Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font-coelacanth: update livecheck #173966

Merged
merged 2 commits into from
May 17, 2024
Merged

font-coelacanth: update livecheck #173966

merged 2 commits into from
May 17, 2024

Conversation

bevanjkay
Copy link
Member

Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.

In the following questions <cask> is the token of the cask you're submitting.

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused.
  • Checked the cask is submitted to the correct repo.
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

Update livecheck to return the correct version.

@bevanjkay
Copy link
Member Author

@samford Are you aware of a way to check a GitHub directory listing that is available to CI?

For whatever reason, when the directory page is fetched on CI, the
HTML doesn't contain links to the zip files. Instead, the file names
are found in some JavaScript, so we have to loosen the regex to be
able to match in either scenario.
Copy link
Member

@samford samford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you aware of a way to check a GitHub directory listing that is available to CI?

For whatever reason, the HTML doesn't contain links to the zip files when fetched on CI (maybe A/B testing?). The file names are found in some JavaScript instead but we can match in either scenario if we loosen the regex. I pushed a commit and it seems good now.

For what it's worth, we could check the GitHub API as follows but it would use the default rate limit (since the request wouldn't use an API token), so checking the HTML page is better for now:

livecheck do
  url "https://api.github.com/repos/Fuzzypeg/Coelacanth/contents/release"
  regex(/coelacanth[._-]v?(\d+(?:\.\d+)+)\.zip/i)
  strategy :json do |json, regex|
    json.map do |item|
      match = item["path"]&.match(regex)
      next if match.blank?

      match[1]
    end
  end
end

@miccal miccal merged commit 768cfce into master May 17, 2024
9 checks passed
@miccal miccal deleted the font-co-lc branch May 17, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants