Impossible to retrieve diff from pull request with token from integration


When using an integration to authenticate to the API I’m able to list pull requests, and I’m able to clone repositories just fine, however I can’t fetch diff files for a pull request.

This is critical in the case of pull requests where the head branch has been deleted. The pull request object has the head.repo value as null, which makes sense seeing as it doesn’t exist any more. I can’t clone a branch that doesn’t exist (obviously), and currently I can’t use the token to download the diff. This leaves me with no way to programmatically determine what changed in a given pull request from an integration.

Can we get the ability to download the diffs from a pull request using an integration’s token somehow?


To answer my own question, diffs aren’t available when the head branch is deleted anyway so for merged commits you have to look at the merge_commit_sha and get a diff from the cloned repo based on that commit.

For a closed pull request where the head branch was deleted, I guess the diff is just gone?