
Automatically Rotating GitHub Tokens (So You Don’t Have To) - Shopify
12/20/2022
This post details the development of a system to automatically rotate GitHub Personal Access Tokens (PATs). The system addresses limitations of GitHub's default `GITHUB_TOKEN` and manually managed PATs by implementing transparent, automatic rotations with short-lived expirations. It leverages GitHub Actions and a GitHub App for token generation, reducing reliance on individual developer accounts and mitigating risks from developer churn. Key design principles include transparency, short expirations, break-glass manual interventions, visible logging, and an approval flow. The post also discusses implementation challenges related to cost (billable minutes rounding) and scheduling reliability, leading to architectural refactoring and a shift in scheduling strategy.