Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Add support for sparse-checkout #1

Closed
wants to merge 13 commits into from
Closed

Add support for sparse-checkout #1

wants to merge 13 commits into from

Conversation

dfdez
Copy link
Owner

@dfdez dfdez commented May 2, 2023

Context:

Monorepo sometimes can be challenging mainly when having a huge base of code. A lot of people have encounter situation where they don't need to fetch everything inside the repository, with this new option anyone will be able to make sparse-checkout inside github action quite simple!

Features:

  • Added sparse-checkout option
  • Added test for sparse-checkout
  • Updated README.md with sparse-checkout option and examples

Usage:

Fetch only the root files

- uses: actions/checkout@v3
  with:
    sparse-checkout: .

Fetch only the root files and .github and src folder

- uses: actions/checkout@v3
  with:
    sparse-checkout: |
      .github
      src

Once the first sparse-checkout is made you can download more folders with the command git sparse-checkout add SOME/DIR/ECTORY more details rewarding sparse-checkout here

Implementation

In order to make sparase-checkout much useful I have added to the git fetch the possibility to add a filter in order to use --filter='blob:none'.

With this update we will make sure that when the fetch is done no blob of the repository will be downloaded (this filter will be done only when sparse-checkout is set), instead the blobs will be downloaded when making the git checkout after having the sparse-checkout configured.

Here you can find the article that I have used to guide me to make the implementation.

Related Issues

@dfdez dfdez self-assigned this May 2, 2023
@dfdez dfdez changed the title feat/sparse checkout feat: sparse-checkout May 2, 2023
@dfdez dfdez changed the title feat: sparse-checkout feat: Support for sparse-checkout May 2, 2023
@dfdez dfdez changed the title feat: Support for sparse-checkout feat: Add support for sparse-checkout May 2, 2023
@dfdez dfdez changed the title feat: Add support for sparse-checkout Add support for sparse-checkout May 13, 2023
@dfdez
Copy link
Owner Author

dfdez commented Jun 9, 2023

Merged here!

@dfdez dfdez closed this Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants