fix(action): set LOCKFILE when package-manager is explicitly specified (#98)#99
Open
pekkanikander wants to merge 1 commit intowithastro:mainfrom
Open
fix(action): set LOCKFILE when package-manager is explicitly specified (#98)#99pekkanikander wants to merge 1 commit intowithastro:mainfrom
pekkanikander wants to merge 1 commit intowithastro:mainfrom
Conversation
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.
Fixes #98.
Note well
I have prepared this PR with the help of Claude Code and ChatGPT Codex, using them to cross-check each other's work. I have personally reviewed the code thoroughly, as well as this PR, but as I don't personally know some of the package managers involved, there may be subtle bugs that have gone unnoticed.
What was wrong
When
package-manageris explicitly set by the user, the "Check lockfiles" step inaction.ymlsetsPACKAGE_MANAGERbut neverLOCKFILE. All auto-detection branches set both; the explicit branch sets only the former.With
LOCKFILEunset,cache-dependency-pathgets evaluated to"./", which gets expanded inactions/setup-noderecursively to every file in the workspace; see #98.Changes
action.ymlAfter
PACKAGE_MANAGERis set in the explicit branch, acasestatement maps it to the expected lockfile name.LOCKFILEis written to$GITHUB_ENVonly if the named file exists on disk. If the file does not exist, e.g. because the lockfile is gitignored, a warning annotation is emitted andLOCKFILEis left unset.The single "Setup Node" step is split into two mutually exclusive steps conditioned on
env.LOCKFILE:with lockfile cache (
env.LOCKFILE != ''): behaviour unchanged from before — passescacheandcache-dependency-pathas before.without lockfile cache (
env.LOCKFILE == ''): setscache:to empty andpackage-manager-cache: falseto fully disable node_modules caching and avoid a hard failure fromactions/setup-node.