1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-07 13:31:37 +02:00

fix(snap): ignore human review error msg

closes #2194

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos A Becker 2021-05-21 02:53:22 +00:00
parent d08b767975
commit 00b76540ca
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -330,7 +330,10 @@ func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries [
return nil
}
const reviewWaitMsg = `Waiting for previous upload(s) to complete their review process.`
const (
reviewWaitMsg = `Waiting for previous upload(s) to complete their review process.`
humanReviewMsg = `A human will soon review your snap`
)
func push(ctx *context.Context, snap *artifact.Artifact) error {
log := log.WithField("snap", snap.Name)
@ -339,7 +342,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) {
if strings.Contains(string(out), reviewWaitMsg) || strings.Contains(string(out), humanReviewMsg) {
log.Warn(reviewWaitMsg)
} else {
return fmt.Errorf("failed to push %s package: %s", snap.Path, string(out))