Skip to content

Commit

Permalink
fix: do not fail if all commits have been filtered out
Browse files Browse the repository at this point in the history
  • Loading branch information
fcanovai authored and fallion committed Jul 26, 2022
1 parent 30f5611 commit bb51ca9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/commitpipeline/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ func (pipeline *Pipeline) Run() (*dispatcher.PipelineSuccess, error) {
log.Infof("%v commits filtered out", len(commits)-len(filteredCommits))
log.Infof("Found %v commit to check", len(filteredCommits))

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

1 comment on commit bb51ca9

@vercel
Copy link

@vercel vercel bot commented on bb51ca9 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.