1

I am new to a GitHub Organization, and some of the document/guides is Not on README.md/Wiki/docs, but on GitHub Pages. So

Is there any way to list all available GitHub Pages on this GitHub Organization?

I've tried gh/git CLI, and GitHub GUI, not none of them could achieve it.

Chen Tian
  • 79
  • 8

2 Answers2

2

Expanding on @VonC's answer, this command in bash will show you only the repositories in which have github pages:

gh api -H "Accept: application/vnd.github+json" orgs/ORG/repos --jq '.[] | {name: .name, has_pages}' --paginate | grep true

sample output:

{"has_pages":true,"name":"repo-with-gh-pages"}
greygore
  • 66
  • 5
1

A user site or an organisation site would be a repository named <username>.github.io or <organization>.github.io, so that is easy enough to check.

But a project site would be any repository with a 'has_pages' attribute set to true.

That means you can list org repositories, focusing on that attribute, to filter out the ones which does have pages

gh api -H "Accept: application/vnd.github+json" /orgs/ORG/repos --jq '.[].has_pages'
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250