Skip to content

Conversation

antoineco
Copy link

@antoineco antoineco commented Jan 8, 2025

If actions/checkout is invoked once with sparse-checkout and cone mode disabled, core.sparseCheckout remains enabled for all subsequent invocations of actions/checkout.

This PR addresses the problem by explicitly (re)setting core.sparseCheckout to false (which is the workaround I currently use in my workflow via a separate step).

Reproduction:

    steps:
      - uses: actions/checkout@v4
        with:
          ref: mybranch
          sparse-checkout-cone-mode: false
          sparse-checkout: /my.config

     # $ ls
     # /my.config

      - uses: actions/checkout@v4
        with:
          ref: mybranch

     # $ ls
     # /my.config

@antoineco antoineco requested a review from a team as a code owner January 8, 2025 12:46
@antoineco antoineco force-pushed the fix/sparse-checkout-not-disabled branch 2 times, most recently from 59c8bd0 to 3b88dfd Compare April 6, 2025 08:42
@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 19:08
@antoineco antoineco force-pushed the fix/sparse-checkout-not-disabled branch from 3b88dfd to 6f4ecf2 Compare August 26, 2025 19:08
Copilot

This comment was marked as outdated.

@antoineco antoineco force-pushed the fix/sparse-checkout-not-disabled branch 2 times, most recently from 72ac6fa to e84ec7a Compare August 26, 2025 19:11
@antoineco antoineco requested a review from Copilot August 26, 2025 19:13
Copilot

This comment was marked as outdated.

@antoineco antoineco force-pushed the fix/sparse-checkout-not-disabled branch from e84ec7a to cf45bbb Compare August 26, 2025 19:15
@antoineco antoineco requested a review from Copilot August 26, 2025 19:15
Copilot

This comment was marked as outdated.

@antoineco antoineco force-pushed the fix/sparse-checkout-not-disabled branch from cf45bbb to 4c58a29 Compare August 26, 2025 19:16
@antoineco antoineco requested a review from Copilot August 26, 2025 19:16
Copilot

This comment was marked as outdated.

If actions/checkout is invoked once with 'sparse-checkout' and cone mode
disabled, core.sparseCheckout remains enabled for all subsequent
invocations of actions/checkout.
@antoineco antoineco force-pushed the fix/sparse-checkout-not-disabled branch from 4c58a29 to 2135832 Compare August 26, 2025 19:19
@antoineco antoineco requested a review from Copilot August 26, 2025 19:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where core.sparseCheckout remains enabled after using actions/checkout with sparse-checkout, affecting subsequent checkout operations that should use the full repository.

  • Explicitly sets core.sparseCheckout to false in the disableSparseCheckout method
  • Ensures sparse-checkout configuration is properly reset for subsequent checkout operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@antoineco antoineco changed the title fix: sparse-checkout not disabled on subsequent checkout Disable sparse-checkout on subsequent checkout Aug 26, 2025
Copy link

@mohannadmir mohannadmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable all

@Nicholechristensen
Copy link

Pull Request Overview

This PR fixes an issue where core.sparseCheckout remains enabled for subsequent uses of actions/checkout after being initially set with sparse-checkout configuration, preventing full repository checkouts.

Key Changes:

  • Adds explicit disabling of core.sparseCheckout config in the disableSparseCheckout() method
  • Ensures subsequent checkout actions work correctly without sparse-checkout restrictions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

1 similar comment
@Nicholechristensen
Copy link

Pull Request Overview

This PR fixes an issue where core.sparseCheckout remains enabled for subsequent uses of actions/checkout after being initially set with sparse-checkout configuration, preventing full repository checkouts.

Key Changes:

  • Adds explicit disabling of core.sparseCheckout config in the disableSparseCheckout() method
  • Ensures subsequent checkout actions work correctly without sparse-checkout restrictions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Successfully merging this pull request may close these issues.

4 participants