当使用自定义域使用 GitHub 页面托管文件时获得 "page url"?

Get a "page url" when a file is hosted using GitHub pages using a custom domain?

如果配置了页面并附加了 自定义域 ,我如何为 GitHub 存储库中的文件获取 "GitHub Pages" URL使用 GitHub API?基本上这个字段的值,但是使用 API:

对于 "standard" 存储库,它是“<reponame>.github.io/bla-bla/page”。

例如,有一个 "has_pages" 属性 可用于确定存储库是否启用了页面,但我没有找到任何名为 "custom_domain" 之类的东西?

已在 v.3.0 的 GitHub API 中添加:https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-a-github-pages-site

/repos/{owner}/{repo}/pages

这将 return 自定义 URL,如果配置(除其他外):

{
  ...
  "html_url": "https://your.custom.url/",
}