Simple trick to save environment and money when using GitHub Actions
GitHub Actions keeps running workflows for outdated pull request commits until they finish or fail. That wastes runner time, money on private repos, and quota on open source ones. Adding a `concurrency` block keyed on workflow name and PR number (falling back to the ref) with `cancel-in-progress: true` makes GitHub cancel stale runs when a PR is updated. In the first week after this change, 56 runs were cancelled in the LibSQL repository.
Related posts
- How we tripled max concurrent jobs to boost performance of GitHub Actions
GitHub Engineering mediumAdeptGitHub Actions on GitHub Enterprise Server went from 2,200 to 7,000 max concurrent jobs on 96-core machines between GHES 3.2 and 3.6 through three main fixes. A hot path for workflow secrets and callback URLs had silently never used its cache, which only showed up in profile traces. Orchestration state moved from a single growing blob column to a per-event table with incremental reads and writes, cutting orchestration CPU by about 50%. Postback load to the Rails checks service was reduced by deferring step updates until run completion and removing duplicate completion events, with a message queue planned to replace the multi-hop HTTP delivery.
- Building GitHub with Ruby and Rails
GitHub Engineering mediumAdeptGitHub's ~2M-line Rails monolith upgrades to the latest Rails main-branch commit every week via a scheduled GitHub Actions workflow that opens an automated PR, runs all builds, and ships the next day. CI also runs a parallel build against the latest Ruby commit, which let GitHub test Ruby 3.2 release candidates on production traffic, catch regressions such as a keyword-argument allocation increase before release, and adopt Ruby 3.2.1 on release day. Benefits include dropping nearly all Rails patches, avoiding big-bang migrations, and better security posture. The approach depends on a thorough test suite and progressive rollout deploys.
- How GitHub uses GitHub Actions and Actions larger runners to build and test GitHub.com
GitHub Engineering mediumAdeptGitHub moved CI for GitHub.com to GitHub Actions on larger runners, peaking at about 4,500 concurrent 32-core runners, 15,000 jobs per hour and 150,000 cores. Custom VM images that pre-bundle tools and a cached build of the project source, refreshed several times a day through an API, cut workflow time from about 50 to 12 minutes. Reusable workflows keep CI configuration and runner selection central across repositories, and reusing results when Git tree IDs match skips 300-500 runs a day. Isolated runners reach private VPC services through an OIDC-token-validating remote access gateway, whose scaffolding is open-sourced.
- AI coding has made CI a bottleneck, so we reworked ours to keep up
Linear mediumAdept
Linear cut pull request CI wait time from over 6 minutes to about 5 and halved runner time per test, even as its test suites nearly quadrupled. The biggest wins came from faster third-party runners (34% faster jobs), switching to tsgo (73% faster typecheck), and rewriting type-aware lint rules as pure AST checks so ESLint and later Oxlint could skip TypeScript. Further gains came from trimming critical-path gating jobs with shallow, sparse and blobless checkouts, a retrying checkout action with low-speed git timeouts, filtered pnpm installs instead of caching node_modules, schema snapshots instead of replaying migrations, and batching short checks, which saved about 87,000 runner-minutes a month. Splitting large Vitest files and moving to eight shards cut the slowest shard from 5.25 to 4.33 minutes.
- Incident Report: November 25th, 2025
Railway mediumAdeptSlow GitHub API calls (about 4x normal p95 latency) during peak hours backed up Railway's Temporal-based task queue, causing workers to run out of memory and crash in a cascading thundering-herd pattern as surviving and newly started workers were overwhelmed by the backlog. Deployments for Free, Trial and Hobby tiers were paused and Pro deploys delayed for roughly two and a half hours, while running services stayed online. Recovery came from increasing worker CPU and memory and fixing worker parameters that made them request more tasks than they could handle. Follow-up measures include an auto-tuning algorithm for worker task intake, more task queue capacity, and removing external API dependencies from critical workflows.