3x faster git checkouts with StarSling Disks
Starting today, StarSling Disks speed up checkouts with the new git-mirror input. StarSling keeps a snapshot of a recent default-branch commit, so set it to true in a job, and that job's git checkout on StarSling Runners runs up to 3x faster.
Every GitHub Actions job checks out the repository before its first real step, and actions/checkout downloads the full tree of the commit each time. On a large repository that download often takes 10 seconds or more, on every job. Earlier this month we launched StarSling Disks, persistent filesystems mounted into StarSling Runners. git-mirror puts the checkout on a Disk too.
Your workflow keeps its actions/checkout step. Before the first step runs, StarSling copies a recent commit of your default branch from a Disk named git into the job's workspace, so actions/checkout downloads only what changed since that commit.
| Checkout | Mastra jobs | Checkout size | Checkout ready |
|---|---|---|---|
GitHub actions/checkout | 10 | 25,308 files, 64.6 MiB | 10.4 s |
StarSling git-mirror | 10 | 25,308 files, 64.6 MiB | 3.5 s |
| StarSling speedup | Same commit | 3.0x |
Checkout ready is the time from the start of the checkout until the workspace holds the commit under test, including the 0.41 s copy from the git disk. All times are medians on a StarSling 4 vCPU runner, with every job checking out the same Mastra commit and the stored copy 12 hours older than that commit.
Mastra turned on git-mirror for 24 of its CI jobs by merging one pull request, opened by a StarSling agent. The pull request has the full A/B: every job with git-mirror finished its checkout faster than the fastest standard checkout.
The git disk holds one commit of your default branch, without its history.
- Seed. The runner reads
git-mirror: truefrom the workflow before any step starts, and copies the stored commit into the job's empty workspace. - Check out. Your
actions/checkoutstep runs first, as it does today. The workspace already holds a recent commit of your default branch, so the step downloads only what changed between that commit and the commit under test. - Refresh. The first successful default-branch job (push, schedule, or manual run) with
git-mirror: truecreates the copy. After that, such a job rebuilds it when its commit is 12 hours or more newer than the stored one. - Self-contained. The copy lands in the workspace's own
.gitfolder, so a Docker step that mounts the workspace sees a complete repository.
git-mirror is set in the workflow file and runs on the same Disks as your dependency stores and build output.
Standard actions/checkout | With git-mirror | |
|---|---|---|
| Checkout action | actions/checkout | actions/checkout (unchanged) |
| Download from GitHub | The full tree of the commit, on every job | What changed since the stored commit |
| Configuration | Workflow YAML | git-mirror: true in workflow YAML |
| Storage | Ephemeral runner disk | StarSling Disk (git), managed with sling disks |
| Workspace layout | Self-contained working tree | Self-contained working tree |
Like every Disk, the git disk encrypts file contents and filenames at rest, with a unique key for each storage layer. Default-branch jobs update it, pull requests and other branches read it, and forks and Dependabot runs stay isolated from it.
Run the job on a StarSling Runners label, grant id-token: write, keep actions/checkout as the first step, and pass git-mirror: true to starslingdev/disks@v0:
jobs:
test:
runs-on: starsling-ubuntu-26.04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: starslingdev/disks@v0
with:
git-mirror: true
- run: pnpm testWhen you add the step:
- Use a literal flag on an unconditional step. The runner reads the workflow before any step runs, so write
git-mirror: trueas a literal value on a step with noif:. - Start with a plain checkout. The copy seeds jobs whose steps run directly on the runner and whose first step is
actions/checkoutof this repository, with noif:orpath, and afetch-depthof 1 or more. The default depth is 1. - Grant OIDC. Each job with
git-mirror: trueneedsid-token: write, so StarSling can verify the job through GitHub OIDC. - Combine it with other Disks.
git-mirror: truecan stand on its own step or share a job with other Disks steps, such aspreset: pnpm-storeorpreset: cargo-target. - Manage it with
sling disks. See thegitdisk withsling disks list. To turn it off, remove the flag from your workflows, then runsling disks delete git --repo <owner/name>. Thesling disksreference and the Disks docs have the details.
The action is open source at starslingdev/disks.
The git disk counts toward your StarSling Disks storage at $0.50 per GB-month, measured daily, with no per-job attach fee. It holds one compressed commit, with no history.
git-mirror is available to every organization on StarSling Runners with billing set up. Sign up with GitHub and add git-mirror: true to your workflows. Once a default-branch job with the flag succeeds, later jobs with the flag start from the copy.
Keep reading