Skip to content

Support Sparse checkouts #800

Closed
Closed
@devminded

Description

@devminded

Discussed in https://github.com/actions/checkout/discussions/798

Originally posted by devminded May 20, 2022

Support sparse checkouts

Purpose

When using large project with many modules (AKA monorepo) being able to do sparse checkouts (supported since git 2.25.x) would be very helpful.

Example

Repo containing:

  • scripts
  • tools
  • modules/mobile-client
  • modules/server
  • modules/web

We want to only checkout and build the mobile-client (nice when combined with paths/paths_ignore).
So the equivalent of git sparse-checkout init --cone && git sparse-checkout set modules/mobile-client scripts tools would be:

- name: Checkout tools repo
  uses: actions/checkout@v3
  with:
    repository: my-org/my-repo
    sparse:
      - modules/mobile-client
      - scripts
      - tools

Ref: https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions