1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 21:29:38 +02:00

Feedback page (#1160)

* Add feedback page

* Only show latest release on changelog

* Constrain changelog height

* Ignore sanitization warning for Github content

* Add cassette for Github release notes

* Lint fix
This commit is contained in:
Zach Gollwitzer 2024-09-09 16:54:56 -04:00 committed by GitHub
parent c30c1b9698
commit eebc07d75e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 310 additions and 37 deletions

View file

@ -40,23 +40,24 @@ class Provider::Github
end
end
def fetch_latest_releases_notes
def fetch_latest_release_notes
begin
Rails.cache.fetch("latest_github_releases_notes", expires_in: 2.hours) do
releases = Octokit.releases(repo)
releases.map do |release|
Rails.cache.fetch("latest_github_release_notes", expires_in: 2.hours) do
release = Octokit.releases(repo).first
if release
{
avatar: release.author.avatar_url,
name: release.name,
published_at: release.published_at,
body: Octokit.markdown(release.body, mode: "gfm", context: repo)
}
else
nil
end
end
rescue => e
Rails.logger.error "Failed to fetch latest GitHub releases notes: #{e.message}"
[]
Rails.logger.error "Failed to fetch latest GitHub release notes: #{e.message}"
nil
end
end