Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get date of last push on github pull request

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.

like image 369
Jesse Avatar asked Oct 28 '25 17:10

Jesse


1 Answers

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.

like image 164
Ivan Zuzak Avatar answered Oct 31 '25 10:10

Ivan Zuzak