Reputation: 317
From the GitHub API you can get a list of commits on a PR, with their commit dates. Like this: https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
These dates seem to be commit datetimes to me. I was wondering if it is possible to obtain the push datetimes.
I want to recreate the order of comments and commits as it is presented on a GitHub PR webpage.
Upvotes: 4
Views: 3503
Reputation: 18762
The only two places you can get the timestamps for when a push happened are:
1) The Events API -- https://developer.github.com/v3/activity/events/. See the PushEvent: https://developer.github.com/v3/activity/events/types/#pushevent. But that API will return only the last 300 events from the past 90 days
2) webhooks -- http://developer.github.com/webhooks/. See the pull_request event which tells you when the head branch is updated through a push (synchronize
). But you need to have admin permissions for a repository to be able to create webhooks.
Upvotes: 3