diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-08-03 23:39:14 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-08-03 23:39:14 +0800 |
commit | 9e06bde269b80b3af01b7cc00bdada1ce2e5e563 (patch) | |
tree | 8aac9ee478aac95cd9a6c51803fe51891349193b /app/models/ci | |
parent | 3691a391524911a21d5af1c75cb4cd16a8a6e475 (diff) | |
download | gitlab-ce-9e06bde269b80b3af01b7cc00bdada1ce2e5e563.tar.gz |
Make sure we only fire hooks upon status changed
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/pipeline.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index f8506e33295..822ba7b6c00 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -18,7 +18,7 @@ module Ci # Invalidate object and save if when touched after_touch :update_state - after_touch :execute_hooks_unless_ci_skipped + after_save :execute_hooks_if_status_changed after_save :keep_around_commits # ref can't be HEAD or SHA, can only be branch/tag name @@ -241,8 +241,8 @@ module Ci save end - def execute_hooks_unless_ci_skipped - execute_hooks unless skip_ci? + def execute_hooks_if_status_changed + execute_hooks if status_changed? && !skip_ci? end def execute_hooks |