Skip to content

fork-ci git-clean: refuses index.sparse, which actions/checkout's own 'sparse-checkout disable' writes (git 2.43) #1259

Done

Description

@scuttletoby

What happens

At ci/v37 (62866d2), git_clean.py check --require refuses the config that actions/checkout writes itself on
git 2.43. This happens on every checkout that has no sparse-checkout input:

::error::git-clean: <ws>/.git/config.worktree holds index.sparse, which actions/checkout never writes.

So docs-scope, job-changed, test-select and head-check fail their first step on every job of a self-hosted runner with
git 2.43 (Ubuntu 24.04's git). A caller cannot move its pin to v37.

Why

actions/checkout (v4.1.2 to v7.0.1, dist/index.js, disableSparseCheckout) runs git sparse-checkout disable
whenever sparse-checkout is not set. It then unsets only extensions.worktreeConfig. On git 2.43 that command writes
this to .git/config.worktree, even in a new repository:

[core]
	sparseCheckout = false
	sparseCheckoutCone = false
[index]
	sparse = false

ALLOWED in fork-ci/actions/git-clean/git_clean.py has core.sparsecheckout and core.sparsecheckoutcone, but not
index.sparse.

Steps to reproduce (git 2.43.0)

git init -q ws && cd ws && git commit -q --allow-empty -m x
git sparse-checkout disable
git config --unset extensions.worktreeConfig      # what checkout does next
GITHUB_WORKSPACE=$PWD RUNNER_TEMP=/tmp python3 -I <v37>/fork-ci/actions/git-clean/git_clean.py check --path . --require
# exit 2, the error above

On a caller's live self-hosted runners, all six SkyRPG runner checkouts fail this check today, right after their last
job's checkout.

Proposed fix

  • Allow index.sparse with a boolean value. It is the same kind of key as core.sparseCheckout, it runs no command
    and it changes nothing git reads from outside the repository.
  • Add a test that runs the real git sparse-checkout disable on the runner's git and checks the result. Today's fixture
    does not catch this.

Found while moving SkyRPG's pin from ci/v10 to ci/v37. That pin bump waits for the fixed release.

Activity

  1. added
    area:ci
    size:small
    type:bug
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cisize:smalltype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions