ConnectAI-E / GitMaya

🌊 One repo = one chat, make git flow in chat, next generation gitops for boosting developer-teams productivity, supports feishu, discord and slack

Home Page:https://gitmaya.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

private仓库传图上传不了

freeziyou opened this issue · comments

https://docs.github.com/en/rest/markdown/markdown?apiVersion=2022-11-28#render-a-markdown-document

如果是私有仓库,试试用这个先渲染成html。

试试看这个渲染之后的html里面的链接是不是有权限?

![image](https://github.com/ConnectAI-E/GitMaya/assets/1826685/24e5782e-2045-4fd3-80b1-b261ebc497b9)

直接在页面上查看的时候,渲染出来的是带jwt的链接,域名也是https://private-user-images.githubusercontent.com/
image

image
image
markdown的api并不会做解析,github应该是在markdown渲染器有额外的未公开的上传接口

https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
往github上传图片,或许可以走这个逻辑。
创建一个draft release
往这个release_id上传assets
从返回的 "browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip", 拿到链接,拿这个链接往相同的repo的issue里面填,应该权限就是一样的了。能看,大家都能看。不能看,大家都不能看
下载的时候,把个人的token放到header里面就能下载了

![image](https://github.com/ConnectAI-E/GitMaya/assets/1826685/24e5782e-2045-4fd3-80b1-b261ebc497b9)

直接在页面上查看的时候,渲染出来的是带jwt的链接,域名也是https://private-user-images.githubusercontent.com/ image

能不能用 GitHub App 的 JWT 试一下能否访问?

我前面的那个消息放错位置了。那个是希望能处理飞书那边的图片传github的问题。

现在github这边私有仓库的图片,可以直接使用用户的token下载,再上传到飞书

#237 直接显示图片链接,这种方案相当于github帮我们做了权限验证