Last active
January 17, 2022 22:06
-
-
Save trashhalo/2e9e7ccf66bc513906461c4a8fbd79df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import { Octokit } from "octokit"; | |
const octokit = new Octokit({ auth: import.meta.env.PUBLIC_GITHUB_TOKEN }); | |
const allRepos = await octokit.rest.repos.listForAuthenticatedUser({ | |
visibility: 'public', | |
per_page: 100 | |
}); | |
// topics are the tags you can assign like "astro". to avoid highlighting my junk projects I am only sharing | |
// projects that have the topic "pin" | |
const repos = allRepos.data. | |
filter(r => r.visibility == 'public' && !r.fork && r.topics.includes('pin')). | |
sort((a, b) => (a.stargazers_count < b.stargazers_count) ? 1 : -1); | |
--- | |
{repos.map((repo) => ( | |
<h4><a href={repo.html_url}>{repo.name}</a></h4> | |
<p>{repo.description}</p> | |
))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment