Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 11 min read Case study mediumAdept

Automatically Rotating GitHub Tokens (So You Don’t Have To)

Shopify replaced long-lived GitHub personal access tokens with short-lived GitHub App installation tokens that are rotated automatically by scheduled GitHub Actions workflows and written into repository secrets. Developers can reference those secrets exactly as they did PATs. The design avoids breakage from developer churn and misattribution of actions, and shrinks the blast radius of leaked tokens. Lessons learned: billable minutes are rounded per job, so parallel jobs were consolidated into one sequential job. The cron `schedule` trigger is best-effort, so it moved to explicit minute-of-hour runs every 15 minutes to stay within the one-hour token expiry. Onboarding evolved into a plop.js wizard with use-case-based permission selection, and a step-by-step recipe for building the rotator closes out the write-up.

Assumes: GitHub Actions workflowsGitHub Appspersonal access tokens

Related posts

  • Incident Report: January 28-29, 2026

    Railway mediumAdept

    Railway users intermittently could not log in with GitHub or deploy from repos over several days because Railway exceeded GitHub's 2,000-per-hour OAuth token limit, with failures recurring about 30 minutes into each hour. The root cause was a dataloader that minted new installation tokens on every request batch (~82/sec at peak), made worse by more backend replicas, fresh user tokens for permission checks, frequent commit status updates and high-frequency repo sync jobs. Generic errors from secondary rate limits slowed diagnosis until GitHub Support confirmed the cause. Fixes included caching installation tokens for their full validity (cutting creation by over 90%), moving code paths from user OAuth tokens to app installation tokens, caching permission checks in Railway's own database, consolidating status updates, making repo sync manual and adding rate-limit alerting.

  • Security Disclosure Recommendation: Check for Anomalous GitHub Access

    Railway mediumAdept

    Railway users who connect GitHub, following the October 21, 2026 security disclosure, should audit their GitHub accounts for persistence an attacker may have left behind, then confirm no unexpected commits reached their deployments. On personal accounts, filter the 90-day security log for authentication and access events and review OAuth apps, GitHub Apps, SSH/GPG keys and personal access tokens, regenerating all tokens. Organization owners should export the 180-day audit log before revoking anything, then check third-party access and each repository's deploy keys, secrets, webhooks and collaborators, since these can outlive a password reset.

  • Staying Evergreen: How we automated secure access and repo hygiene in a shared org

    GitHub Engineering mediumAdept

    Evergreen is a Go-based GitHub App that automates quarterly outside-collaborator access reviews and stale-repo archival in a shared org of 1,400+ GitHub employees, customers and partners, built entirely from native primitives: scheduled Actions firing repository_dispatch, webhooks, issue checklists, custom properties, and per-repo JSON state files in git that double as the audit trail. It fails secure by revoking all access when a review goes unanswered, fails closed by keeping reviews pending until every removal succeeds, and never deletes anything. Rollout relied on a DRY_RUN mode, logfmt logs in Splunk, and proactive pacing to stay under GitHub's secondary content-creation rate limits of 80 requests/minute and 500/hour.

  • Using GitHub Actions with Heroku Flow for additional Security Control

    Heroku Engineering mediumAdept

    Because GitHub Orgs can't allowlist Heroku IP ranges, Heroku offers a sample pattern: a self-hosted GitHub Actions runner deployed as a Docker app in a Heroku Private Space with static outbound IPs, plus a Heroku Flow Action. The action uses the Platform API's Source Endpoint to upload private repo code, deploy apps on push, dispatch or schedule events, and create, update or remove Review Apps on pull request events. A weekly scheduled workflow rebuilds and redeploys the runner to meet GitHub's 30-day update requirement. Tradeoffs include no repo link in the Review App UI, no automatic Heroku CI tests, no Fir support, and a custom runner image that other actions should be tested against.

  • Our response to the Axios developer tool compromise

    OpenAI mediumAdept

    A GitHub Actions workflow in OpenAI's macOS app-signing pipeline downloaded and executed a malicious Axios 1.14.1 during the March 31, 2026 npm supply chain attack, exposing the code-signing certificate and notarization material for ChatGPT Desktop, Codex, Codex CLI and Atlas. OpenAI judged exfiltration unlikely because of payload timing and job sequencing, but is treating the certificate as compromised: it is rotating it, blocking new notarizations with Apple, and fully revoking it on May 8, 2026 after a 30-day update window. The root cause was a workflow that used a floating tag instead of a pinned commit hash and had no minimumReleaseAge for new packages. Both settings are concrete mitigations for CI pipelines that handle signing secrets.

The quest for software engineering knowledge.

Look:
Layout: