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

Use npm as fallback if no packageManager specified #190

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

1000hz
Copy link
Contributor

@1000hz 1000hz commented Oct 9, 2023

Fixes #180

#173 added a new packageManager input to allow users to optionally specify which package manager they'd like to use when running the action. If the value isn't specified, it attempts to infer the appropriate package manager based on the presence of a lockfile. However, if no lockfile is found it throws an error. This was an inadvertent breaking change.

Instead of throwing an error when the input isn't specified and no lockfile is found, we should now fallback to the previous behavior of using npm. Specifying an unsupported package manager, however, throws an error.

This PR also refactors the package manager logic and tests into its own module.

@1000hz 1000hz requested a review from a team as a code owner October 9, 2023 22:29
@1000hz 1000hz changed the title Refactor to use npm as a fallback if no packageManager specified Use npm as fallback if no packageManager specified Oct 9, 2023
@1000hz 1000hz merged commit c2494c1 into main Oct 10, 2023
3 checks passed
@1000hz 1000hz deleted the cina/180-fix-undefined-package-manager branch October 10, 2023 14:14
@github-actions github-actions bot mentioned this pull request Oct 10, 2023
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.

Error: Package manager is not detected
2 participants