Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[讨论]:检查插件分支是否存在 #260

Closed
alex3236 opened this issue Mar 21, 2023 · 4 comments
Closed

[讨论]:检查插件分支是否存在 #260

alex3236 opened this issue Mar 21, 2023 · 4 comments

Comments

@alex3236
Copy link
Contributor

例如 ToDoList,分支与实际不匹配。

github api似乎在分支不存在的时候会跳转默认分支,因此可以正常抓取,但这样是不是合理?

@zyxkad
Copy link
Contributor

zyxkad commented Mar 21, 2023

github api似乎在分支不存在的时候会跳转默认分支,因此可以正常抓取

Github api在分支不存在时似乎不会自动跳转到默认分支? 例如 https://api.github.com/repos/Flash-Z/MCDReforgedPlugins/readme/ToDoList?ref=master

默认分支为
https://api.github.com/repos/Flash-Z/MCDReforgedPlugins/readme/ToDoList

@Fallen-Breath
Copy link
Member

Fallen-Breath commented Mar 22, 2023

请给出具体的“github api似乎在分支不存在的时候会跳转默认分支,因此可以正常抓取”的例子

插件仓库 meta 分支的数据拉取中,对于仓库内的文件,是从 https://raw.githubusercontent.com 拉取的文件内容,并未使用 github api

对于 ToDoList 这个插件,其仓库中分支为 main,但其 plugin_info.json 中填写的是 master。对此:

猜测可能是 github 自动将 master 重定向至 main,但也仅会做这一个重定向。对于其他不存在的分支,依然无法访问

@alex3236
Copy link
Contributor Author

因此是有必要检查的

@Fallen-Breath
Copy link
Member

Fallen-Breath commented Apr 2, 2023

因此是有必要检查的

请给出理由,以及“请给出具体的“github api似乎在分支不存在的时候会跳转默认分支,因此可以正常抓取” (#260 (comment) )的例子。根据目前情况而言,我认为是无需做检查

@alex3236 alex3236 changed the title [讨论]:抓取 meta 时,是否应当检查插件分支是否存在? [讨论]:PR Check 时检查插件分支是否存在 Apr 2, 2023
@alex3236 alex3236 changed the title [讨论]:PR Check 时检查插件分支是否存在 [讨论]:检查插件分支是否存在 Apr 2, 2023
@AnzhiZhang AnzhiZhang removed their assignment Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants