Skip to content

Commit

Permalink
Prowgen will propagate OWNERS to openshift/release (#143)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi authored Apr 3, 2024
1 parent e052643 commit 9a5fc2b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/prowgen/prowgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,26 @@ func SaveReleaseBuildConfiguration(outConfig *string, cfg ReleaseBuildConfigurat
if err := os.WriteFile(filepath.Join(*outConfig, cfg.Path), out, os.ModePerm); err != nil {
return err
}

owners, err := os.ReadFile("OWNERS")
if err != nil {
// Log just a warning
log.Printf("failed to read file: %v", err)
return nil
}
ownerAliases, err := os.ReadFile("OWNERS_ALIASES")
if err != nil {
// Log just a warning
log.Printf("failed to read file: %v", err)
return nil
}
if err := os.WriteFile(filepath.Join(dir, "OWNERS"), owners, os.ModePerm); err != nil {
return err
}
if err := os.WriteFile(filepath.Join(dir, "OWNERS_ALIASES"), ownerAliases, os.ModePerm); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 9a5fc2b

Please sign in to comment.