mirror of
https://github.com/dolphin-emu/redmine_webhook.git
synced 2026-01-31 01:15:19 +01:00
Add support to avoid triggering webhooks
This commit is contained in:
committed by
Donovan JEAN
parent
f00b1aaa26
commit
cb8c6fda11
@@ -1,7 +1,16 @@
|
||||
module RedmineWebhook
|
||||
class WebhookListener < Redmine::Hook::Listener
|
||||
|
||||
def skip_webhooks(context)
|
||||
request = context[:request]
|
||||
if request.headers['X-Skip-Webhooks']
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def controller_issues_new_after_save(context = {})
|
||||
return if skip_webhooks(context)
|
||||
issue = context[:issue]
|
||||
controller = context[:controller]
|
||||
project = issue.project
|
||||
@@ -11,6 +20,7 @@ module RedmineWebhook
|
||||
end
|
||||
|
||||
def controller_issues_edit_after_save(context = {})
|
||||
return if skip_webhooks(context)
|
||||
journal = context[:journal]
|
||||
controller = context[:controller]
|
||||
issue = context[:issue]
|
||||
|
||||
Reference in New Issue
Block a user