checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Inconsistent behaviour with sparse-checkout: --filter can only be used when extensions.partialClone is set

Open magmanu opened this issue 2 years ago • 9 comments

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.conf exists 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

magmanu avatar Oct 04 '23 17:10 magmanu

+1

epoch70 avatar Oct 06 '23 10:10 epoch70

+1

sandeepprasai avatar Oct 19 '23 17:10 sandeepprasai

I'm having the same issue.

mazzy89 avatar Jan 08 '24 15:01 mazzy89

Same issue

kmkacpermajor avatar Mar 17 '24 15:03 kmkacpermajor

Me too

robertellicott avatar Mar 19 '24 20:03 robertellicott

Same here..

jakub-lesniak-ikea avatar Apr 08 '24 17:04 jakub-lesniak-ikea

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.

cbb330 avatar Apr 08 '24 22:04 cbb330

Similar for me - I realized I had an old git version 2.25, so just bumping the version made this work.

jakub-lesniak-ikea avatar Apr 09 '24 07:04 jakub-lesniak-ikea