mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 22:56:22 +00:00
17 lines
471 B
Ruby
17 lines
471 B
Ruby
|
# 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
|