From 384376190297544754bc7ae71e6efcfc9c462253 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Wed, 26 May 2021 14:39:11 +0000 Subject: [PATCH] fix(snap): do not fail with "NEEDS REVIEW" message Signed-off-by: Carlos A Becker --- internal/pipe/snapcraft/snapcraft.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pipe/snapcraft/snapcraft.go b/internal/pipe/snapcraft/snapcraft.go index 2137385ec..2d8d33de5 100644 --- a/internal/pipe/snapcraft/snapcraft.go +++ b/internal/pipe/snapcraft/snapcraft.go @@ -333,6 +333,7 @@ func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries [ const ( reviewWaitMsg = `Waiting for previous upload(s) to complete their review process.` humanReviewMsg = `A human will soon review your snap` + needsReviewMsg = `(NEEDS REVIEW)` ) func push(ctx *context.Context, snap *artifact.Artifact) error { @@ -342,7 +343,7 @@ func push(ctx *context.Context, snap *artifact.Artifact) error { /* #nosec */ cmd := exec.CommandContext(ctx, "snapcraft", "upload", "--release=stable", snap.Path) if out, err := cmd.CombinedOutput(); err != nil { - if strings.Contains(string(out), reviewWaitMsg) || strings.Contains(string(out), humanReviewMsg) { + if strings.Contains(string(out), reviewWaitMsg) || strings.Contains(string(out), humanReviewMsg) || strings.Contains(string(out), needsReviewMsg) { log.Warn(reviewWaitMsg) } else { return fmt.Errorf("failed to push %s package: %s", snap.Path, string(out))