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

Recent Update to v4.1.3 Causes LibGit2SharpException with Sparse Checkout #1689

Closed
skylayer opened this issue Apr 22, 2024 · 10 comments
Closed

Comments

@skylayer
Copy link

Hello,

After the recent update to actions/checkout@v4.1.3, we have encountered an issue when handling repositories after a sparse checkout using LibGit2Sharp. The workflow that was functioning correctly with v4.1.1 started throwing an exception post-update.

Here's the snippet of the workflow configuration that triggers the issue:

- name: Checkout repository
  uses: actions/checkout@v4
  with:
    submodules: true
    fetch-depth: 0
    fetch-tags: true
    filter: blob:limit=100k

When our program processes the repository with the above checkout command, it results in the following unhandled exception:

Unhandled exception. LibGit2Sharp.LibGit2SharpException: unsupported extension name extensions.worktreeconfig

This exception did not occur with version v4.1.1. I'm unsure how to proceed and address this issue, and any guidance would be greatly appreciated.

Thank you for looking into this.

@jww3
Copy link
Contributor

jww3 commented Apr 22, 2024

Hi @skylayer. We will investigate. In the meantime, you can pin your workflow to v4.1.1

Example

- name: Checkout repository
  uses: actions/checkout@v4.1.1
  with:
    submodules: true
    fetch-depth: 0
    fetch-tags: true
    filter: blob:limit=100k

@jww3
Copy link
Contributor

jww3 commented Apr 22, 2024

Is it possible you're hitting this documented (and recently fixed) lib2git issue?

libgit2/libgit2#6044

@TheMoonDawg
Copy link

TheMoonDawg commented Apr 22, 2024

We are also hitting this issue. Primarily when we're utilizing checkout for the getsentry/action-release@v1 action.

 Error: Command failed: /action-release/node_modules/@sentry/cli-linux-x64/bin/sentry-cli releases propose-version
error: Could not automatically determine release name:
	 unsupported extension name extensions.worktreeconfig; class=Repository (6) 

Please ensure your version control system is configured correctly, or provide a release name manually.

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

This error only popped up with the latest release of checkout.

@robdsoule
Copy link

We are also seeing the

We are also hitting this issue. Primarily when we're utilizing checkout for the getsentry/action-release@v1 action.

 Error: Command failed: /action-release/node_modules/@sentry/cli-linux-x64/bin/sentry-cli releases propose-version
error: Could not automatically determine release name:
	 unsupported extension name extensions.worktreeconfig; class=Repository (6) 

Please ensure your version control system is configured correctly, or provide a release name manually.

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

This error only popped up with the latest release of checkout.

We are also seeing this same issue with the latest actions/checkout and getsentry/action-release@v1 action.

@skylayer
Copy link
Author

Hi @skylayer. We will investigate. In the meantime, you can pin your workflow to v4.1.1

Example

- name: Checkout repository
  uses: actions/checkout@v4.1.1
  with:
    submodules: true
    fetch-depth: 0
    fetch-tags: true
    filter: blob:limit=100k

Thank you for your assistance, @jww3.
I have implemented your suggestion to pin my workflow to v4.1.1, and it is now running successfully.

Is it possible you're hitting this documented (and recently fixed) lib2git issue?

libgit2/libgit2#6044

It seems that the issue is related to LibGit2, but I currently lack the bandwidth to investigate further.
Anyway, it’s working now (x

Thanks for quick responding!

@SS1823
Copy link

SS1823 commented Apr 23, 2024

I've hit the same bug, but with rust git2 (uses libgit2 1.7.2)

@jww3
Copy link
Contributor

jww3 commented Apr 23, 2024

Workaround: pin workflows to actions/checkout@v4.1.1

Proposed fix: #1692

@jww3
Copy link
Contributor

jww3 commented Apr 24, 2024

We have created release v4.1.4 and marked it as pre-release. Absent any other issues, we plan to promote v4.1.4 to v4 and latest by end-of-week.

@hicksjacobp
Copy link

Given that the default CodeQL workflow references actions/checkout@v4, it will pull any latest minor or patch versions that get released including v4.1.3. Our repos using the default CodeQL setup are now failing due to actions/checkout performing a sparse checkout, and their build also happens to have another dependency such as Microsoft.SourceLink.GitHub@v1.1.1 that doesn't support git v1.

In the case of Microsoft.SourceLink.GitHub, I found updating to 8.0.0 can also resolve the issue, due to dotnet/sourcelink#772

It would be wise for future versions of actions/checkout to be mindful of relying on newer features of performing git checkouts when there are other aspects of a repository/build and actions that may not be prepared to understand newer git features.

@jww3
Copy link
Contributor

jww3 commented Apr 25, 2024

v4 and latest now point to release v4.1.4

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

6 participants