gangplank: allow for the case where no builds were created
This will skip the attempt at uploading artifacts if no builds
exist. This happens in cases like `cosa fetch --update-lockfile`,
which is what we use for our lockfile bumper.
@@ -43,7 +43,10 @@ func (r *Return) Run(ctx context.Context, ws *workSpec) error {
}
baseBuildDir := filepath.Join(cosaSrvDir, "builds")
b, path, err := cosa.ReadBuild(baseBuildDir, "", cosa.BuilderArch())
- if err != nil {
+ if err == cosa.ErrNoBuildsFound {
+ // If there are no builds, ignore
+ return nil
+ } else if err != nil {
return err
}
if b == nil {
