Navigation Menu

Skip to content

GraphQL: How to get a list of commits between tags or releases #24779

Discussion options

You must be logged in to vote

So if you only want to get the list of commits from the HEAD of the master branch back to some release tag, you could use this query:

{
  repository(owner: "lee-dohm", name: "octicons-ex") {
    object(expression: "v0.5.0") {
      ... on Commit {
        oid
        messageHeadline
        committedDate
        author {
          user {
            login
          }
        }
      }
    }
  }
}

to get the information on the commit pointed to by the given tag (“v0.5.0” in my example). From there you could get the committedDate value to supply to this query:

{
  repository(owner: "lee-dohm", name: "octicons-ex") {
    nameWithOwner
    object(expression: "master") {
      ... on Commit {…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants