Inconsistent behaviour with sparse-checkout: --filter can only be used when extensions.partialClone is set
Hi folks 👋🏽
This action is behaving a bit funny in my workflow. Update: It works as expected on the main branch, but it's consistently failing when running against other branches, throwing the following error:
--filter can only be used when extensions.partialClone is set
Then it exits with code 128.
Re-running the workflow manually doesn't fix it.
Step:
- name: Checkout conf
uses: actions/checkout@v4
with:
path: config
sparse-checkout: zap.conf
sparse-checkout-cone-mode: false
Logs on a bad run (dev branch):
Wed, 04 Oct 2023 17:39:37 GMT
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --filter=blob:none --depth=1 origin +REDACTED:refs/remotes/origin/dev_branch
Wed, 04 Oct 2023 17:39:37 GMT
Error: fatal: --filter can only be used when extensions.partialClone is set
Wed, 04 Oct 2023 17:39:37 GMT
The process '/usr/bin/git' failed with exit code 128
Details:
- git version 2.42.0
- Trigger: workflow dispatch
- Run was targeting workflow1.yml on
dev_branch, the step is as described above - manually re-running did not solve the issue
- I confirm
zap.confexists in the branch
Logs on a good run (main branch):
Wed, 04 Oct 2023 15:50:35 GMT
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --filter=blob:none --depth=1 origin +REDACTED:refs/remotes/origin/main
Wed, 04 Oct 2023 15:50:36 GMT
remote: Enumerating objects: 9265, done.
...
Details:
- Same git version
- Trigger: repository dispatch
- Run targeting workflow1.yml on
main, the step is as described above
Thanks
+1
+1
I'm having the same issue.
Same issue
Me too
Same here..
For me, bumping git to at least 2.28 fixed this issue. I found the solution from this thread: https://github.com/actions/checkout/issues/1386
I recognize in your description your git version is stated 2.42.
so my solution is just one data point.
Similar for me - I realized I had an old git version 2.25, so just bumping the version made this work.