chore: add support for new bun.lock

This commit is contained in:
James Ross 2024-09-26 01:02:47 +01:00
parent f111269956
commit 8bc5c5f050
No known key found for this signature in database
GPG key ID: 49E8B07166BE49AB
4 changed files with 9 additions and 6 deletions

View file

@ -6,7 +6,7 @@ on:
- main - main
- master - master
schedule: schedule:
- cron: '0 0 * * *' - cron: "0 0 * * *"
name: Semgrep config name: Semgrep config
jobs: jobs:
semgrep: semgrep:

View file

@ -289,7 +289,7 @@ https://<your_pages_site>.pages.dev
### Using a different package manager ### Using a different package manager
By default, this action will detect which package manager to use, based on the presence of a `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb` file. By default, this action will detect which package manager to use, based on the presence of a `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`/`bun.lock` file.
If you need to use a specific package manager for your application, you can set the `packageManager` input to `npm`, `yarn`, `pnpm`, or `bun`. You don't need to set this option unless you want to override the default behavior. If you need to use a specific package manager for your application, you can set the `packageManager` input to `npm`, `yarn`, `pnpm`, or `bun`. You don't need to set this option unless you want to override the default behavior.

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "wrangler-action", "name": "wrangler-action",
"version": "3.6.1", "version": "3.7.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "wrangler-action", "name": "wrangler-action",
"version": "3.6.1", "version": "3.7.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",

View file

@ -44,7 +44,10 @@ function detectPackageManager(
if (existsSync(path.join(workingDirectory, "pnpm-lock.yaml"))) { if (existsSync(path.join(workingDirectory, "pnpm-lock.yaml"))) {
return "pnpm"; return "pnpm";
} }
if (existsSync(path.join(workingDirectory, "bun.lockb"))) { if (
existsSync(path.join(workingDirectory, "bun.lockb")) ||
existsSync(path.join(workingDirectory, "bun.lock"))
) {
return "bun"; return "bun";
} }
return null; return null;