-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add support for partial checkout filters #1396
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
Add support for partial checkout filters #1396
Conversation
|
bump +1 this would be nice to use with Yarn |
|
i've used this fork/branch successfully with both |
|
I think It would be almost exactly as small, but without breaking the Git history. |
| CLONE_FILTER=$(git config --local --get remote.origin.partialclonefilter) | ||
|
|
||
| if [ "$CLONE_FILTER" != "blob:none" ]; then | ||
| echo "Expected ./fetch-filter/.git/config to have 'remote.origin.partialclonefilter' set to 'blob:none'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you miss exit 1 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good spot 😳
|
This is exactly what we need in our repo. Speeds up checkout by a factor of 4 without breaking git history so our existing logic that uses |
|
Thanks for your contribution. Do you mind adding an update to https://github.com/actions/checkout/blob/72f2cec99f417b1a1c5e2e88945068983b7965f9/action.yml#L56C19-L60 with the new setting with a note that it will override the The rest LGTM. |
|
Will take a look as to whats causing the test to fail soon... |
|
@cory-miller the test actions should pass now 🙏 |
|
Thanks for working on this! I will build a release soon. |
This is a cool feature, but please don't make the default checkout larger for everyone since most users don't need the Git history in their CI pipelines. We do often need the history, so we tried switching from |
|
I think there's something missing from the docs here; you still need to explicitly set - use: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:noneWithout setting it, you still only get the most recent commit. For the TypeScript repo:
For example, https://github.com/microsoft/TypeScript/actions/runs/6359689867/job/17272959471?pr=55923 (though this link will eventually break) |
|
@jakebailey, did you mean |
|
Yes, that's just a typo on my part. |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v3` -> `v4` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v4`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v410) [Compare Source](actions/checkout@v3...v4) - [Add support for partial checkout filters](actions/checkout#1396) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS43IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNyIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9--> Reviewed-on: https://git.apud.pl/jacek/adventofcode/pulls/38 Co-authored-by: Renovate <[email protected]> Co-committed-by: Renovate <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v3` -> `v4` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v4`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v410) [Compare Source](actions/checkout@v3...v4) - [Add support for partial checkout filters](actions/checkout#1396) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNDEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE0MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Reviewed-on: https://gitea.int.magicalinternetbox.net/joel/rhel-wireguard/pulls/10 Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v4` -> `v5.0.0` | [](https://securityscorecards.dev/viewer/?uri=github.com/actions/checkout) | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v5.0.0`](https://github.com/actions/checkout/releases/tag/v5.0.0) [Compare Source](actions/checkout@v4.3.0...v5.0.0) #### What's Changed - Update actions checkout to use node 24 by [@​salmanmkc](https://github.com/salmanmkc) in [#​2226](actions/checkout#2226) - Prepare v5.0.0 release by [@​salmanmkc](https://github.com/salmanmkc) in [#​2238](actions/checkout#2238) ####⚠️ Minimum Compatible Runner Version **v2.327.1**\ [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1) Make sure your runner is updated to this version or newer to use this release. **Full Changelog**: <actions/checkout@v4...v5.0.0> ### [`v4.3.0`](https://github.com/actions/checkout/releases/tag/v4.3.0) [Compare Source](actions/checkout@v4.2.2...v4.3.0) #### What's Changed - docs: update README.md by [@​motss](https://github.com/motss) in [#​1971](actions/checkout#1971) - Add internal repos for checking out multiple repositories by [@​mouismail](https://github.com/mouismail) in [#​1977](actions/checkout#1977) - Documentation update - add recommended permissions to Readme by [@​benwells](https://github.com/benwells) in [#​2043](actions/checkout#2043) - Adjust positioning of user email note and permissions heading by [@​joshmgross](https://github.com/joshmgross) in [#​2044](actions/checkout#2044) - Update README.md by [@​nebuk89](https://github.com/nebuk89) in [#​2194](actions/checkout#2194) - Update CODEOWNERS for actions by [@​TingluoHuang](https://github.com/TingluoHuang) in [#​2224](actions/checkout#2224) - Update package dependencies by [@​salmanmkc](https://github.com/salmanmkc) in [#​2236](actions/checkout#2236) - Prepare release v4.3.0 by [@​salmanmkc](https://github.com/salmanmkc) in [#​2237](actions/checkout#2237) #### New Contributors - [@​motss](https://github.com/motss) made their first contribution in [#​1971](actions/checkout#1971) - [@​mouismail](https://github.com/mouismail) made their first contribution in [#​1977](actions/checkout#1977) - [@​benwells](https://github.com/benwells) made their first contribution in [#​2043](actions/checkout#2043) - [@​nebuk89](https://github.com/nebuk89) made their first contribution in [#​2194](actions/checkout#2194) - [@​salmanmkc](https://github.com/salmanmkc) made their first contribution in [#​2236](actions/checkout#2236) **Full Changelog**: <actions/checkout@v4...v4.3.0> ### [`v4.2.2`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v422) [Compare Source](actions/checkout@v4.2.1...v4.2.2) - `url-helper.ts` now leverages well-known environment variables by [@​jww3](https://github.com/jww3) in [#​1941](actions/checkout#1941) - Expand unit test coverage for `isGhes` by [@​jww3](https://github.com/jww3) in [#​1946](actions/checkout#1946) ### [`v4.2.1`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v421) [Compare Source](actions/checkout@v4.2.0...v4.2.1) - Check out other refs/\* by commit if provided, fall back to ref by [@​orhantoy](https://github.com/orhantoy) in [#​1924](actions/checkout#1924) ### [`v4.2.0`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v420) [Compare Source](actions/checkout@v4.1.7...v4.2.0) - Add Ref and Commit outputs by [@​lucacome](https://github.com/lucacome) in [#​1180](actions/checkout#1180) - Dependency updates by [@​dependabot-](https://github.com/dependabot-) [#​1777](actions/checkout#1777), [#​1872](actions/checkout#1872) ### [`v4.1.7`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v417) [Compare Source](actions/checkout@v4.1.6...v4.1.7) - Bump the minor-npm-dependencies group across 1 directory with 4 updates by [@​dependabot](https://github.com/dependabot) in [#​1739](actions/checkout#1739) - Bump actions/checkout from 3 to 4 by [@​dependabot](https://github.com/dependabot) in [#​1697](actions/checkout#1697) - Check out other refs/\* by commit by [@​orhantoy](https://github.com/orhantoy) in [#​1774](actions/checkout#1774) - Pin actions/checkout's own workflows to a known, good, stable version. by [@​jww3](https://github.com/jww3) in [#​1776](actions/checkout#1776) ### [`v4.1.6`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v416) [Compare Source](actions/checkout@v4.1.5...v4.1.6) - Check platform to set archive extension appropriately by [@​cory-miller](https://github.com/cory-miller) in [#​1732](actions/checkout#1732) ### [`v4.1.5`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v415) [Compare Source](actions/checkout@v4.1.4...v4.1.5) - Update NPM dependencies by [@​cory-miller](https://github.com/cory-miller) in [#​1703](actions/checkout#1703) - Bump github/codeql-action from 2 to 3 by [@​dependabot](https://github.com/dependabot) in [#​1694](actions/checkout#1694) - Bump actions/setup-node from 1 to 4 by [@​dependabot](https://github.com/dependabot) in [#​1696](actions/checkout#1696) - Bump actions/upload-artifact from 2 to 4 by [@​dependabot](https://github.com/dependabot) in [#​1695](actions/checkout#1695) - README: Suggest `user.email` to be `41898282+github-actions[bot]@​users.noreply.github.com` by [@​cory-miller](https://github.com/cory-miller) in [#​1707](actions/checkout#1707) ### [`v4.1.4`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v414) [Compare Source](actions/checkout@v4.1.3...v4.1.4) - Disable `extensions.worktreeConfig` when disabling `sparse-checkout` by [@​jww3](https://github.com/jww3) in [#​1692](actions/checkout#1692) - Add dependabot config by [@​cory-miller](https://github.com/cory-miller) in [#​1688](actions/checkout#1688) - Bump the minor-actions-dependencies group with 2 updates by [@​dependabot](https://github.com/dependabot) in [#​1693](actions/checkout#1693) - Bump word-wrap from 1.2.3 to 1.2.5 by [@​dependabot](https://github.com/dependabot) in [#​1643](actions/checkout#1643) ### [`v4.1.3`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v413) [Compare Source](actions/checkout@v4.1.2...v4.1.3) - Check git version before attempting to disable `sparse-checkout` by [@​jww3](https://github.com/jww3) in [#​1656](actions/checkout#1656) - Add SSH user parameter by [@​cory-miller](https://github.com/cory-miller) in [#​1685](actions/checkout#1685) - Update `actions/checkout` version in `update-main-version.yml` by [@​jww3](https://github.com/jww3) in [#​1650](actions/checkout#1650) ### [`v4.1.2`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v412) [Compare Source](actions/checkout@v4.1.1...v4.1.2) - Fix: Disable sparse checkout whenever `sparse-checkout` option is not present [@​dscho](https://github.com/dscho) in [#​1598](actions/checkout#1598) ### [`v4.1.1`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v411) [Compare Source](actions/checkout@v4.1.0...v4.1.1) - Correct link to GitHub Docs by [@​peterbe](https://github.com/peterbe) in [#​1511](actions/checkout#1511) - Link to release page from what's new section by [@​cory-miller](https://github.com/cory-miller) in [#​1514](actions/checkout#1514) ### [`v4.1.0`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v410) [Compare Source](actions/checkout@v4...v4.1.0) - [Add support for partial checkout filters](actions/checkout#1396) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTEuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE1MS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJtYWpvciIsInZlcnNpb24tdXBkYXRlIl19--> Reviewed-on: https://git.xmsl.im/WolfYangFan/PortHog/pulls/9 Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
A change to add support for sparse checkouts has been added recently (#1369). This extends upon that to allow support for other filters, and the ability to filter without a sparse checkout.
Inspired by this blog post -> https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone