Skip to content

Commit

Permalink
hack/prowjob-gen skip creating empty files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jan 18, 2024
1 parent 26b8ebf commit 7b3415c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hack/tools/prowjob-gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ func (g *generator) generate() error {
return errors.Wrapf(err, "Generating prowjobs for template %s", tpl.Name)
}

if out.Len() == len(generatedFileHeader) {
klog.Infof("Skipping template %s for branch %s because the resulting file would have been empty", tpl.Name, branch)
continue
}

fileName, err := g.executeNameTemplate(branch, tpl.Name)
if err != nil {
return errors.Wrapf(err, "Generating name for template %s and branch %s", tpl.Name, branch)
Expand Down

0 comments on commit 7b3415c

Please sign in to comment.