Only execute GitlabCiService for push events.
This commit is contained in:
parent
d86c0cda24
commit
f13567edc4
1 changed files with 7 additions and 2 deletions
|
@ -22,8 +22,6 @@ class GitlabCiService < CiService
|
|||
validates :project_url, presence: true, if: :activated?
|
||||
validates :token, presence: true, if: :activated?
|
||||
|
||||
delegate :execute, to: :service_hook, prefix: nil
|
||||
|
||||
after_save :compose_service_hook, if: :activated?
|
||||
|
||||
def compose_service_hook
|
||||
|
@ -32,6 +30,13 @@ class GitlabCiService < CiService
|
|||
hook.save
|
||||
end
|
||||
|
||||
def execute(data)
|
||||
object_kind = data[:object_kind]
|
||||
return unless object_kind == "push"
|
||||
|
||||
service_hook.execute(data)
|
||||
end
|
||||
|
||||
def commit_status_path(sha)
|
||||
project_url + "/commits/#{sha}/status.json?token=#{token}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue