How to find the zipball url for a release by specifying it's tag?

community-help

#1

For example I have a release tagged v0.0.1 and I want to download it’s zip.
How to structure graphql query to find the zipball_url?

Now I’m here with this query

{
  repository(owner: "x", name: "yy") {
    releases(last:1,orderBy:{field:CREATED_AT,direction:DESC}) {
      edges {
        node {
          tag {
            name
            target {
              ... on Commit {
                zipballUrl
              }
            }
          }
        }
      }
    }
  }
}

This can find the last release but I don’t know how to get a specific release.


#2

#3

Hi @icrtiou,

It’s possible to lookup a single release on the Repository object with the release field and tag_name argument: https://developer.github.com/v4/object/repository/#release

{
  repository(owner: "x", name: "yy") {
    release(tag_name: "v0.0.1") {
      tag {
        name
        target {
          ... on Commit {
            zipballUrl
          }
        }
      }
    }
  }
}

Cheers!