Home > Software design >  Get date of review request from GitHub API
Get date of review request from GitHub API

Time:10-27

How do I get the timestamp at which a PR review was request/re-requested? It shows as an event in the conversations tab in a PR so it must exist somewhere.

enter image description here

The pulls API endpoint show who has been requested to review but I can't see when.

 "requested_reviewers": [
    {
      "login": "tamlyn",
       ...
    },
  ],

Any ideas?

CodePudding user response:

You're looking for the GitHub Timeline API. See the docs for the Timeline API here.

Request:

curl \
  -H "Accept: application/vnd.github json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/timeline

Response:

...
{
        "id": "12345",
        ...
        "actor": {
            "login": "user",
            ...
        },
        "event": "review_requested",
        "created_at": "2022-01-01T01:01:01Z",
        ...
        "review_requester": {
            "login": "user",
            ...
        },
        "requested_reviewer": {
            "login": "user2",
            ...
        },
        ...
},
...
  • Related