From 9d5ebedce36dd52858f1136e6f6a752448bd5868 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 6 Aug 2015 00:48:27 +0200 Subject: Prefer `failed` commit status over `skipped` if no builds were created --- app/models/commit.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index ec65d19..68057b7 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -161,15 +161,13 @@ class Commit < ActiveRecord::Base end def status - if skip_ci? || builds.none? + if skip_ci? return 'skipped' - end - - if yaml_errors.present? + elsif yaml_errors.present? return 'failed' - end - - if success? + elsif builds.none? + return 'skipped' + elsif success? 'success' elsif pending? 'pending' -- cgit v1.2.1