1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-05 00:59:04 +02:00

fix: do not retry upload if file already exists (#1390)

* fix: do not retry upload if file already exists

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: logs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: gitea client

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: godocs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2020-03-22 17:03:31 -03:00
committed by GitHub
parent 6519be8dfb
commit 0736162d5e
6 changed files with 50 additions and 27 deletions

View File

@ -158,7 +158,7 @@ func (c *githubClient) Upload(
if err != nil {
return err
}
_, _, err = c.client.Repositories.UploadReleaseAsset(
_, resp, err := c.client.Repositories.UploadReleaseAsset(
ctx,
ctx.Config.Release.GitHub.Owner,
ctx.Config.Release.GitHub.Name,
@ -168,5 +168,8 @@ func (c *githubClient) Upload(
},
file,
)
return err
if resp.StatusCode == 422 {
return err
}
return RetriableError{err}
}