Inform user about questionable hook success
This commit is contained in:
parent
f4e0c56279
commit
23a3e3756a
1 changed files with 4 additions and 2 deletions
|
@ -27,8 +27,10 @@ class Projects::HooksController < Projects::ApplicationController
|
|||
if !@project.empty_repo?
|
||||
status, message = TestHookService.new.execute(hook, current_user)
|
||||
|
||||
if status
|
||||
flash[:notice] = "Hook successfully executed, HTTP #{status} #{message}"
|
||||
if status && status >= 200 && status < 400
|
||||
flash[:notice] = "Hook executed successfully"
|
||||
elsif status
|
||||
flash[:alert] = "Hook executed successfully but returned HTTP #{status} #{message}"
|
||||
else
|
||||
flash[:alert] = "Hook execution failed: #{message}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue