From f6aa55bb5883a6a68f74510bfb79fc2bdf26e59c Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 2 May 2023 19:53:43 +0200 Subject: [PATCH] feat: README.md updated with sparse-checkout option --- README.md | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8fe140f..f168287 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,10 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl # Default: true clean: '' + # Do a sparse checkout on given patterns (each pattern should be sepparated with new lines). + # Default: null + sparse-checkout: '' + # Number of commits to fetch. 0 indicates all history for all branches and tags. # Default: 1 fetch-depth: '' @@ -106,15 +110,35 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl # Scenarios -- [Fetch all history for all tags and branches](#Fetch-all-history-for-all-tags-and-branches) -- [Checkout a different branch](#Checkout-a-different-branch) -- [Checkout HEAD^](#Checkout-HEAD) -- [Checkout multiple repos (side by side)](#Checkout-multiple-repos-side-by-side) -- [Checkout multiple repos (nested)](#Checkout-multiple-repos-nested) -- [Checkout multiple repos (private)](#Checkout-multiple-repos-private) -- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit) -- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event) -- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token) +- [Fetch only the root files](#fetch-only-the-root-files) +- [Fetch only the root files and `.github` and `src` folder](#fetch-only-the-root-files-and-github-and-src-folder) +- [Fetch all history for all tags and branches](#fetch-all-history-for-all-tags-and-branches) +- [Checkout a different branch](#checkout-a-different-branch) +- [Checkout HEAD^](#checkout-head) +- [Checkout multiple repos (side by side)](#checkout-multiple-repos-side-by-side) +- [Checkout multiple repos (nested)](#checkout-multiple-repos-nested) +- [Checkout multiple repos (private)](#checkout-multiple-repos-private) +- [Checkout pull request HEAD commit instead of merge commit](#checkout-pull-request-head-commit-instead-of-merge-commit) +- [Checkout pull request on closed event](#checkout-pull-request-on-closed-event) +- [Push a commit using the built-in token](#push-a-commit-using-the-built-in-token) + +## Fetch only the root files + +```yaml +- uses: actions/checkout@v3 + with: + sparse-checkout: . +``` + +## Fetch only the root files and `.github` and `src` folder + +```yaml +- uses: actions/checkout@v3 + with: + sparse-checkout: | + .github + src +``` ## Fetch all history for all tags and branches