I can see all events for a particular user, for example here are mine:
https://api.github.com/users/arasbm/events
But I am only interested in events of a particular type:
"type": "PushEvent",
How can I get this data without having to process the list of all events (which can be slow). I am trying to do this because I want to get a list of all my PRs that have been merged. If you can give me the curl command that would be awesome. I can not find this anywhere in the github api docs.
As confirmed in "How do I get notifications for commits to the framework?", you would have to filter the JSON /users/username/events
response.
$.each(data.data, function(key, val) {
if (val.type == "PushEvent") {
$.each(val.payload.commits, function(key2, val2) {
list.append('<li id="' + val2.sha + '"><a href="https://github.com/UnionOfRAD/lithium/commit/' + val2.sha + '">' + val2.message + '</a> [' + val.actor.login + ' @ ' + val.created_at + ']</li>');
});
}
});
Or:
You can monitor the commit RSS feed (as in "Setting up an Github Commit RSS feed":
https://github.com/user/repo/commits/master.atom
# more general url:
https://github.com/user/repo/commits/branch_name.atom?login=login&token=token
But that would be for one repo of one user though, not for all the user repos.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With