Skip to content
Development

Fixing the stale GitHub pinned-repo list

By Victor Da Luz•
astrogithubdev-logsite

The homepage’s “On GitHub” section has a row of auto-generated repo cards, pulled from a stats service based on a hardcoded list in src/data/projects.ts. The comment above that list says “Mirrors the pinned repos on the GitHub profile.” It didn’t.

The array still had trello-extractor and programming-problems in it, two repos I unpinned a while back. And it was missing astro-affiliate and astro-opt-in-analytics, two libraries I pinned more recently. I checked the actual pinned set via GitHub’s GraphQL API to be sure, rather than trusting what the code claimed.

Worth noting: this site already has a separate, hand-written “Shared packages” section listing all three @vdaluz/* libraries with pitches and links. This fix is specifically about the auto-generated pinned-repo card images, which is a different rendering path that only knew about astro-blog among the three.

The fix was one line:

pinnedRepos: ['homelab-tools', 'astro-blog', 'astro-affiliate', 'astro-opt-in-analytics'],

I verified it in a real browser rather than trusting the build: started the dev server, navigated to the homepage, and checked both the accessibility tree and the actual network requests hitting the stats API. All four repo-card requests came back 200 with the right repo names in the right order, and the rendered cards matched.

The lesson here isn’t really about the code, it’s about the comment. “Mirrors the pinned repos” was true when it was written and then quietly went stale as my GitHub profile changed. A hardcoded list with no drift check will always eventually lie about what it claims to mirror.

Related reading

You might also find useful

Proton

Proton Pass

Privacy-focused password manager from the team behind Proton Mail.

As a Proton Partner, I earn from qualifying purchases of Proton's privacy and security services (Pass, Mail, VPN, Drive).

Learn more
Proton

Proton VPN

Commercial VPN with NetShield filtering and a kill switch.

As a Proton Partner, I earn from qualifying purchases of Proton's privacy and security services (Pass, Mail, VPN, Drive).

Learn more
NordPass

NordPass

Password manager from the team behind NordVPN, with a free tier.

As a NordPass affiliate, I earn from qualifying purchases.

Learn more