I'm currently trying to script something up in Node using Octokit that will allow me to measure the first commit of a user within a GitHub organisation.
It's fairly trivial to get a list of all the users within that organisation, but where I'm hitting a snag is the commit search API. Initially I thought if my personal access token had full repo
and org:read
permissions, I should be able to pretty much hit the commit search API like so:
const commits = await octokit.request(
`GET /search/commits?q=author:${login}&order=asc&sort=committer-date&per_page=10}`, {});
And away I'd go. But the results I'm getting back indicate this is not working - it's like the author parameter is ignored (and yes, I've checked the ${substitution}
is working as intended and passed in a hardcoded url with a given login). I'm getting a bunch of public commits on repos that are absolutely not mine.
So I thought I'd take a step back here and see if this is a solved problem elsewhere; basically within a given organisation, I'd like to list the members, their creation date, and the date of their first commit. Is there a different set of GitHub APIs that I should be looking at here?