ops forgejo release: add upload-asset verb #75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
coily ops forgejo releaseships CRUD verbs (coilysiren/coily#72) but intentionally deferred asset upload. Operators publishing artifacts (formula tarballs, scoop archives, factorio mods) still have to curl directly.Scope
Add under
coily ops forgejo release:upload-asset --repo <owner/name> --id ID --file PATH [--name N]->POST /repos/{owner}/{repo}/releases/{id}/assetsDifferent mechanism than the JSON CRUD path:
Content-Type: multipart/form-datawith anattachmentfile part (forgejo acceptsnameas a form field to override the asset filename).json.Marshal-> bytes buffer.Implementation suggestion: extract a
forgejoAPIDoMultipartsibling offorgejoAPIDothat takes a*multipart.Writer, reuses the token fetch + status-code discipline. Validate the source file exists and has non-zero size before upload to fail fast.Why
Closes the gap left by coilysiren/coily#72. Releases without an asset-upload path mean automation flows still have a
curlfallback for the publish step.