Skip to content

Release API does not expose attachments #711

Closed
@bkcsoft

Description

@bkcsoft
  • Gitea version (or commit ref): 7e401b9

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions