How to get raw image URL or content from a GitHub repo file using GraphQL

Viewed 843

I am trying to automate some stuff that will require to get the current images from a GitHub private repo.

Ideally, I'd iterate over the root directory and, for all images, get the URL for the RAW file.

For example:

If the URL is not available, I could get around with getting the binary content. However, I couldn't find a way to do that either.

As an example, this is basically how I am "finding" files that I want de details of.

{
  repository(owner: "Flow2015", name: "logo") {
    name
    object(expression: "master:") {
      ... on Tree {
        entries {
          name
          object{
            ... on Blob {
              text
            }
          }
        }
      }
    }
  }
}

I understand that I could build the URL using Repo/branch/filename, I'm just trying to find a safe way if there is one.

0 Answers
Related