The CI Challenge: save 10% or get $1,000

← Back to blog

3x faster git checkouts with StarSling Disks

·By: Ali Kayes, Founding Engineer, StarSling
View in markdown
A tight row of dark frosted glass plates standing on a reflective obsidian floor in Prussian blue and verdigris teal, with a single marigold-edged glass pane streaking rapidly ahead to the right trailing luminous teal and gold speed lines

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.

CheckoutMastra jobsCheckout sizeCheckout ready
GitHub actions/checkout1025,308 files, 64.6 MiB10.4 s
StarSling git-mirror1025,308 files, 64.6 MiB3.5 s
StarSling speedupSame commit3.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: true from the workflow before any step starts, and copies the stored commit into the job's empty workspace.
  • Check out. Your actions/checkout step 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: true creates 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 .git folder, 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/checkoutWith git-mirror
Checkout actionactions/checkoutactions/checkout (unchanged)
Download from GitHubThe full tree of the commit, on every jobWhat changed since the stored commit
ConfigurationWorkflow YAMLgit-mirror: true in workflow YAML
StorageEphemeral runner diskStarSling Disk (git), managed with sling disks
Workspace layoutSelf-contained working treeSelf-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 test

When 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: true as a literal value on a step with no if:.
  • Start with a plain checkout. The copy seeds jobs whose steps run directly on the runner and whose first step is actions/checkout of this repository, with no if: or path, and a fetch-depth of 1 or more. The default depth is 1.
  • Grant OIDC. Each job with git-mirror: true needs id-token: write, so StarSling can verify the job through GitHub OIDC.
  • Combine it with other Disks. git-mirror: true can stand on its own step or share a job with other Disks steps, such as preset: pnpm-store or preset: cargo-target.
  • Manage it with sling disks. See the git disk with sling disks list. To turn it off, remove the flag from your workflows, then run sling disks delete git --repo <owner/name>. The sling disks reference 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.