Release API does not expose attachments #258

Closed
opened 2025-11-02 03:16:14 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @bkcsoft on GitHub (Jan 20, 2017).

Description

Releases can now have attachments #673 🎉 But the API was not updated to reflect this 🙁

The bare minumum for basic functionality are:

  • update /repos/:owner/:repo/releases[/:id] with
    {
     "assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
     "assets": [
        {
          "url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
          "browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
          "id": 1,
          "name": "example.zip",
          "label": "short description",
          "state": "uploaded",
          "content_type": "application/zip",
          "size": 1024,
          "download_count": 42,
          "created_at": "2013-02-27T19:35:32Z",
          "updated_at": "2013-02-27T19:35:32Z",
          "uploader": {
            "login": "octocat",
            "id": 1,
            "avatar_url": "https://github.com/images/error/octocat_happy.gif",
            "gravatar_id": "",
            "url": "https://api.github.com/users/octocat",
            "html_url": "https://github.com/octocat",
            "followers_url": "https://api.github.com/users/octocat/followers",
            "following_url": "https://api.github.com/users/octocat/following{/other_user}",
            "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
            "organizations_url": "https://api.github.com/users/octocat/orgs",
            "repos_url": "https://api.github.com/users/octocat/repos",
            "events_url": "https://api.github.com/users/octocat/events{/privacy}",
            "received_events_url": "https://api.github.com/users/octocat/received_events",
            "type": "User",
            "site_admin": false
          }
        }
      ]
     }
    
  • List assets: GET /repos/:owner/:repo/releases/:id/assets
  • Get single asset: GET /repos/:owner/:repo/releases/assets/:id

Nice to have but could be it's own PR

  • Edit asset: PATCH /repos/:owner/:repo/releases/assets/:id
  • Delete asset: DELETE /repos/:owner/:repo/releases/assets/:id
  • Upload asset: POST /repos/:owner/:repo/releases/:id/assets?name=foo.zip

Ref: https://developer.github.com/v3/repos/releases/#list-assets-for-a-release

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41166037-release-api-does-not-expose-attachments?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).
Originally created by @bkcsoft on GitHub (Jan 20, 2017). - Gitea version (or commit ref): https://github.com/go-gitea/gitea/commit/7e401b9e3993d9b3e4e64ba63d36fbcbdf688430 ## Description Releases can now have attachments #673 🎉 But the API was not updated to reflect this 🙁 The bare minumum for basic functionality are: - update `/repos/:owner/:repo/releases[/:id]` with ``` { "assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets", "assets": [ { "url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1", "browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip", "id": 1, "name": "example.zip", "label": "short description", "state": "uploaded", "content_type": "application/zip", "size": 1024, "download_count": 42, "created_at": "2013-02-27T19:35:32Z", "updated_at": "2013-02-27T19:35:32Z", "uploader": { "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false } } ] } ``` - List assets: `GET /repos/:owner/:repo/releases/:id/assets` - Get single asset: `GET /repos/:owner/:repo/releases/assets/:id` Nice to have but could be it's own PR - Edit asset: `PATCH /repos/:owner/:repo/releases/assets/:id` - Delete asset: `DELETE /repos/:owner/:repo/releases/assets/:id` - Upload asset: `POST /repos/:owner/:repo/releases/:id/assets?name=foo.zip` Ref: https://developer.github.com/v3/repos/releases/#list-assets-for-a-release <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41166037-release-api-does-not-expose-attachments?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>
GiteaMirror added the type/enhancementmodifies/api labels 2025-11-02 03:16:14 -06:00
Author
Owner

@esell commented on GitHub (Jan 26, 2017):

Curious, since POSTing files to releases isn't supported yet, is there any work around to create releases with files attached to them? I am looking at automating a release process via jenkins.

EDIT: looks like you can do this in two steps currently.

  1. POST https://gitea/attachments
    1a. get uuid from response

  2. POST https://gitea/:user/:repo/releases/new
    2a. as part of the form data put the uuid from above into the files value

@esell commented on GitHub (Jan 26, 2017): Curious, since POSTing files to releases isn't supported yet, is there any work around to create releases with files attached to them? I am looking at automating a release process via jenkins. EDIT: looks like you can do this in two steps currently. 1. POST https://gitea/attachments 1a. get uuid from response 2. POST https://gitea/:user/:repo/releases/new 2a. as part of the form data put the uuid from above into the `files` value
Author
Owner

@jonasfranz commented on GitHub (Feb 8, 2018):

I'am currently working on this issue. We are calling assets currently attachments should this be also taken over to the api? Or should I use assets as @bkcsoft suggested?

@jonasfranz commented on GitHub (Feb 8, 2018): I'am currently working on this issue. We are calling `assets` currently `attachments` should this be also taken over to the api? Or should I use `assets` as @bkcsoft suggested?
Author
Owner

@bkcsoft commented on GitHub (Feb 10, 2018):

@JonasFranzDEV It should be whatever GitHub API is calling it 🙂

@bkcsoft commented on GitHub (Feb 10, 2018): @JonasFranzDEV It should be whatever GitHub API is calling it 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#258