Skip to content

Issue Accessing Private Repository Attachments with GitHub App Installation Token #148227

Discussion options

You must be logged in to vote

Turns out there is actually a way you can fetch the comment from the api (or whatever the attachment is connected to)

    const response = await octokit.request(
      "GET /repos/{owner}/{repo}/issues/comments/{comment_id}",
      {
        owner: repo.githubOwner,
        repo: repo.githubRepoName,
        comment_id: comment.id,
        headers: {
          accept: "application/vnd.github.full+json",
        },
      },
    );

this will return:

  1. body: md
  2. body_text: plain text
  3. body_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

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mukul98s
Comment options

@rtpa25
Comment options

Answer selected by mukul98s
@mukul98s
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions and conversations related to APIs or Webhooks Question
3 participants