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:
parent
c30c1b9698
commit
eebc07d75e
10 changed files with 310 additions and 37 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue