Skip to content

Instantly share code, notes, and snippets.

@mxdvl
Created February 4, 2021 15:11
Show Gist options
  • Save mxdvl/d30794bc3bce21ff8b534a0280e90ff8 to your computer and use it in GitHub Desktop.
Save mxdvl/d30794bc3bce21ff8b534a0280e90ff8 to your computer and use it in GitHub Desktop.
Default @guardian repo branches
const user = "orgs/guardian";
const repos = await fetch(
`https://api.github.com/${user}/repos?per_page=100&sort=updated&direction=desc`,
).then((r) => r.json());
type Repo = Record<string, string>;
repos
.filter((repo: Repo) => repo.default_branch !== "main")
.map((repo: Repo) => console.log(repo.default_branch, " — ",repo.full_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment