Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

How do I get information about users who have committed to a concrete file?

 

I want to get list of files from specific directory and list of users who changed file.

 

repository(owner: "isoftninja", name: "api-test") {
      object(expression: "master:files") {
        ... on GitHub_Tree {
          entries {
            name
            object {
              ... on GitHub_Commit {
                id
                history(last: 10) {
                  nodes {
                    id
                    author {
                      name
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
"files": [
            {
              "name": "first-file.md",
              "object": {}
            },
            {
              "name": "second.md",
              "object": {}
            }
]

Tried a lot of options, but not one is not suitable. Show an example of how to do it.

 

1 Reply
Community Manager
Message 2 of 2

Re: How do I get information about users who have committed to a concrete file?

Something like this sounds like what you're looking for:

 

{
  repository(owner: "atom", name: "atom") {
    defaultBranchRef {
      target {
        ... on Commit {
          history(path: "src/application-delegate.js") {
            nodes {
              ... on Commit {
                author {
                  name
                }
              }
            }
          }
        }
      }
    }
  }  
}

 

I hope that helps!