Skip to content

Commit

Permalink
move check for empty perComponentSkippedTargetPaths up
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvarts committed Oct 29, 2024
1 parent 71d8a4e commit e275a78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/pkg/githubapi/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,10 @@ func getPromotionSkipPaths(promotion PromotionInstance) map[string]bool {
perComponentSkippedTargetPaths := promotion.Metadata.PerComponentSkippedTargetPaths
promotionSkipPaths := map[string]bool{}

if len(perComponentSkippedTargetPaths) == 0 {
return promotionSkipPaths
}

// if any promoted component is not in the perComponentSkippedTargetPaths
// then that means we have a component that is promoted to all paths,
// therefore, we return an empty promotionSkipPaths map to signify that
Expand All @@ -1163,10 +1167,6 @@ func getPromotionSkipPaths(promotion PromotionInstance) map[string]bool {
}
}

if len(perComponentSkippedTargetPaths) == 0 {
return promotionSkipPaths
}

// if we have one or more components then we are just going to
// user the component that has the fewest skipPaths when
// generating the promotion prBody. This way the promotion
Expand Down

0 comments on commit e275a78

Please sign in to comment.