Issue Accessing Private Repository Attachments with GitHub App Installation Token #148227
-
Select Topic AreaQuestion BodyI am encountering an issue with accessing user-attachments from a private repository via a GitHub App. While the URL works perfectly when using a Personal Access Token (PAT), it returns a 404 Not Found error when I use an installation token generated by the GitHub App. Here are the details: GitHub App Configuration Steps Taken
Sample curl Request Here’s the request I used with the installation token: curl -H "Authorization: Bearer <installation_token>" \
-H "Accept: application/vnd.github.v3+json" \
<attachment_url> Response: 404 Not Found. The same request works with a Personal Access Token. Request for Assistance Could you help me understand why the GitHub App’s installation token cannot access user-attachments in the private repository? Is there a specific permission or configuration required for accessing such attachments that I might have overlooked? Thank you for your support! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Damm this is a hard problem am trying to solve this same issue since the last 2 days here's what I have discovered Linear's github sync seems to have achieved this I don't know how they are solving this problem |
Beta Was this translation helpful? Give feedback.
Turns out there is actually a way you can fetch the comment from the api (or whatever the attachment is connected to)
this will return:
body
: mdbody_text
: plain textbody_html
: html --> this key will consist of the tag with the image src which will have a short lived jwt attached to it, so you can download it immediately and store it in your own bucket