Skip to content

Commit c7d6988

Browse files
committed
fix: do not fail if all commits have been filtered out
1 parent 30f5611 commit c7d6988

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/commitpipeline/run.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ func (pipeline *Pipeline) Run() (*dispatcher.PipelineSuccess, error) {
6767
log.Infof("%v commits filtered out", len(commits)-len(filteredCommits))
6868
log.Infof("Found %v commit to check", len(filteredCommits))
6969

70+
if len(filteredCommits) == 0 && len(commits) > 0 {
71+
return &dispatcher.PipelineSuccess{
72+
Message: aurora.Sprintf(aurora.Green("All commits have been filtered out. Nothing to check."), len(commits)),
73+
PipelineName: pipeline.Name(),
74+
}, nil
75+
}
7076
if len(filteredCommits) == 0 {
7177
return nil, errors.New(aurora.Red("No commits found, please check you are on a branch outside of main").String())
7278
}

0 commit comments

Comments
 (0)