Inconsistent behaviour with sparse-checkout: --filter can only be used when extensions.partialClone is set
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the workflow step using actions/checkout@v4 and compare the logged fetch commands for main and dev_branch. Reproduce the sparse-checkout case with Git 2.42.0, then trace how the action prepares and fetches non-main branches. Done means the same configuration no longer exits with code 128 and works consistently across branches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100