Interrupting `gh release upload` with `--clobber` leads to data loss
CLI Feedback
What was confusing or gave you pause?
When uploading an asset to a release using --clobber, the existing artifact will be deleted before uploading the new one:
| if a.ExistingURL != "" { | |
| if err := deleteAsset(ctx, httpClient, a.ExistingURL); err != nil { | |
| return err | |
| } | |
| } |
This means that in case the upload of the new asset is interrupted, the existing asset is already gone (I experienced this first-hand, sadly). I would have expected that the new assets replaces the existing one only after the upload of the new one has succeeded, but it looks like there's no API endpoint for that anyways.
Therefore, I think the documentation could be more expressive to mention this behavior. Maybe something like Delete existing assets before uploading assets of the same name instead of Overwrite existing assets [...]?