最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to pull the HTML page for a GitHub issue from the command line? - Stack Overflow

programmeradmin0浏览0评论

I am trying to find a way to download all the issues from a GitHub repository to have a local backup. I found this tool that can download issues as both JSON and HTML files. It works fine for public repos, but for private repos the HTML pull fails (this is a known issue and the developer said they don't intend to address it).

I've been trying to find a workaround myself and keep hitting walls. The basic HTML pull for a public repo works fine:

curl -L ";

When going to a private repo, I can pull the JSON for issues using the API:

curl -L \
     -H "Accept: application/vnd.github.html+json" \
     -H "Authorization: Bearer $token" \
     -H "X-GitHub-Api-Version: 2022-11-28" \
        > issues.json

so I know my authorization token is valid. However, when I try to combine these to get the HTML version of the issues, all I get is a 404 Not Found Error:

curl -L \
     -H "Authorization: Bearer $token" \
        > issue4.html

I've tried including other header info like the API version, the Authorized user, the format (using the "Accept" header), using "token" instead of "Bearer", and nothing seems able to get past the 404. I assume it's some sort of authorization error, but I can't figure out how to solve it. Anyone have suggestions/solutions?

发布评论

评论列表(0)

  1. 暂无评论