Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Option sparse-checkout-cone-mode is not honored correctly when using git < 2.37 #1868

Open
samkearney opened this issue Aug 28, 2024 · 1 comment

Comments

@samkearney
Copy link

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.

@samkearney
Copy link
Author

@samkearney samkearney changed the title Option sparse-checkout-cone-mode is not honored correctly when using git < 2.37 [bug] Option sparse-checkout-cone-mode is not honored correctly when using git < 2.37 Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant