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

Don't set packageManager default via action.yml #193

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dirty-poets-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler-action": patch
---

Fixed the package manager not being inferred based on lockfile when the `packageManager` input isn't set.
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ inputs:
description: "A string of environment variable names, separated by newlines. These will be bound to your Worker using the values of matching environment variables declared in `env` of this workflow."
required: false
packageManager:
description: "The package manager you'd like to use to install and run wrangler. If not specified, a value will be inferred based on the presence of a lockfile. Valid values: [npm, pnpm, yarn, bun]"
description: "The package manager you'd like to use to install and run wrangler. If not specified, the preferred package manager will be inferred based on the presence of a lockfile or fallback to using npm if no lockfile is found. Valid values are `npm` | `pnpm` | `yarn` | `bun`."
required: false
default: npm
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

2 changes: 1 addition & 1 deletion src/packageManagers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("getPackageManager", () => {
}
`);

expect(getPackageManager('bun', { workingDirectory: "test/bun" }))
expect(getPackageManager("bun", { workingDirectory: "test/bun" }))
.toMatchInlineSnapshot(`
{
"exec": "bunx",
Expand Down
2 changes: 1 addition & 1 deletion src/packageManagers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const PACKAGE_MANAGERS = {
},
bun: {
install: "bun i",
exec: "bunx"
exec: "bunx",
},
} as const satisfies Readonly<Record<string, PackageManager>>;

Expand Down
2 changes: 1 addition & 1 deletion test/bun/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "wrangler-action-bun-test",
"name": "wrangler-action-bun-test"
}
Loading