fix(#1027): Improve yarn v4+ corepack support with better error handling#1479
Open
Satishchoudhary94 wants to merge 1 commit intoactions:mainfrom
Open
fix(#1027): Improve yarn v4+ corepack support with better error handling#1479Satishchoudhary94 wants to merge 1 commit intoactions:mainfrom
Satishchoudhary94 wants to merge 1 commit intoactions:mainfrom
Conversation
…r handling This change improves the action's handling of yarn v4+ which requires corepack. Changes: - Add enableCorepackIfSupported() helper function to automatically enable corepack - Update yarn getCacheFolderPath to call corepack enable before checking yarn version - Detect corepack-related errors and provide clear, actionable error messages - Users can either enable corepack before the action or disable caching The error message now clearly explains: - The requirement for corepack with yarn v4+ - How to enable corepack: 'corepack enable' - Alternative: disable caching with 'package-manager-cache: false' - Link to GitHub issue for more context Fixes actions#1027 Related: actions#1027
Contributor
|
Hi @Satishchoudhary94, thank you for your contribution! After discussion, we’ve decided not to pursue this PR at this time because starting with Node.js 25, Corepack will no longer be bundled with Node.js, which affects how this change would work for future versions. For reference, please visit the nodejs-corepack documentation. If you have any further concerns, please don’t hesitate to reach out. We appreciate your feedback and suggestions for future enhancements. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Yarn v4+ requires corepack, but the action tried to use yarn v1.22.22 from the system,
causing the error:
Solution
Changes
enableCorepackIfSupported()helper functiongetCacheFolderPath()to enable corepack and detect version mismatch errorsTesting