Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Sparse checkouts #800

Closed
devminded opened this issue May 21, 2022 Discussed in #798 · 7 comments
Closed

Support Sparse checkouts #800

devminded opened this issue May 21, 2022 Discussed in #798 · 7 comments

Comments

@devminded
Copy link

Discussed in #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/

@devminded
Copy link
Author

Related #172 #680

@mversluys
Copy link

Worth noting that this https://github.com/actions/checkout/blob/main/src/git-source-provider.ts#L188 causes all LFS files to be retrieved for the given branch.

When using sparse-checkout AND lfs, checkout will only download lfs files as needed so the sparse rules can be used to prevent a lot of stuff being downloaded which is great, but only with the call to git lfs fetch origin ... being removed.

@KIC
Copy link

KIC commented Mar 17, 2023

any news on this? I this feature planned to be implemented?

@dfdez
Copy link
Contributor

dfdez commented May 13, 2023

Hey everyone! Good news for those that need this feature, I have created a PR to add sparse-checkout support! 🎉

@dfdez
Copy link
Contributor

dfdez commented Jun 10, 2023

This Issue has been solved! #1369

@tamird
Copy link

tamird commented Aug 2, 2023

This can probably be closed? @TingluoHuang

@devminded
Copy link
Author

Thank you very much team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants