Is it possible to get PR diff as a GitHub App?

When I use OAuth Apps, I can get a git diff of PRs, using application/vnd.github.3.diff accept header, but when I use GitHub App, it says “Resource not accessible by integration”. Is there a way to get this diff?


Hey there @korolvs :wave:

I’m fairly confident the solution here is simple to the marked solution in this post:

Though I’ve seen other users also move away from the .diff in favor of the .patch endpoint which will return your diff.

Curious to know how you go!

If you still have trouble, I’d be curious to know what scope is applied to the key you’re using for the app. The key may simply not have the proper permissions but I bet the solution above from that other thread will get you what you need.


It does work for OAuth Apps but doesn’t work for GitHub Apps.

Thanks @korolvs :bow:

Let me see what I can find out about Apps v OAuth and why that Resource not accessible by integration message is coming through.

I’ll do my best to do some research on this and get back with you.

1 Like

Hey again @korolvs !

So after poking around, there are a number of things that could potentially be happening. To that end, I have a few questions, if you don’t mind?

  1. Is your App publicly available? If so, could you link it?
  2. Is the PR you’re trying to query against also public? If so, link?
  3. How are you authenticating your app? (as a GitHub App / as an installation)

Add a repository to an app installation; Check a token; Create a content Get allowed actions for an enterprise; Get GitHub Actions permissions for an For example, to request a pull request as diff format, set the mediaType.format option.

1 Like

You can also swap your head and base branches with the drop-down lists to establish diffs between reference points.