discourse/plugins/discourse-github/app/jobs/scheduled/grant_github_badges.rb
2025-07-22 15:07:59 +02:00

16 lines
443 B
Ruby
Vendored

# frozen_string_literal: true
module DiscourseGithubPlugin
class UpdateJob < ::Jobs::Scheduled
every 4.hours
def execute(args)
return unless SiteSetting.enable_discourse_github_plugin?
return unless SiteSetting.github_badges_enabled?
return if SiteSetting.github_linkback_access_token.blank?
GithubRepo.repos.each { |repo| CommitsPopulator.new(repo).populate! }
GithubBadges.grant!
end
end
end