diff --git a/internal/pkg/githubapi/github.go b/internal/pkg/githubapi/github.go index a33f5cbe..8192e6ca 100644 --- a/internal/pkg/githubapi/github.go +++ b/internal/pkg/githubapi/github.go @@ -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 @@ -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