Open
Description
To reproduce:
On a runner/image with git < 2.37 (for example, Ubuntu 22.04):
on: push
jobs:
test:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- run: |
apt-get update
apt-get install -y git tree
- uses: actions/checkout@v4
with:
sparse-checkout: subdir/subdir
sparse-checkout-cone-mode: true
- run: |
echo "Sparse checkout: $(git config --get core.sparseCheckout)"
echo "Cone mode: $(git config --get core.sparseCheckoutConeMode)"
tree
Expected Results: Checked-out tree contains top-level files in the repo, per the sparse-checkout documentation on cone mode
Results: Only subdirectory specified is present in the tree
Note: Cone mode became the default in Git 2.37. In earlier versions of Git, cone mode needs to be set explicitly to work (e.g. git sparse-checkout set --cone
). But the Checkout action is not doing this.
Metadata
Metadata
Assignees
Labels
No labels