5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 22:56:22 +00:00
panel/app/controllers/api/v1/webhooks_controller.rb

17 lines
471 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Api
module V1
# Recibe webhooks y lanza jobs
class WebhooksController < BaseController
def pull
# encontrar el sitio
site = Site.find_by_name(params[:site_id])
usuarie = GitAuthor.new email: "webhook@#{Site.domain}", name: 'Webhook'
message = I18n.t('webhooks.pull.message')
GitPullJob.perform_later(site, usuarie, message)
end
end
end
end