Skip to content

Commit

Permalink
Merge pull request #10022 from chrischdi/pr-prowjob-gen-skip-empty
Browse files Browse the repository at this point in the history
🌱 hack/prowjob-gen skip creating empty files
  • Loading branch information
k8s-ci-robot committed Jan 18, 2024
2 parents 26b8ebf + 7b3415c commit 0aa6b62
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 0aa6b62

Please sign in to comment.