Merge pull request #294 from Cherry/chore/bun-lockfile-new

chore: add support for new bun.lock
This commit is contained in:
Maximo Guk 2024-09-26 12:38:45 -03:00 committed by GitHub
commit bcff5386ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 6 deletions

View file

@ -1,12 +1,12 @@
on:
pull_request: {}
workflow_dispatch: {}
push:
push:
branches:
- main
- master
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
name: Semgrep config
jobs:
semgrep:

View file

@ -289,7 +289,7 @@ https://<your_pages_site>.pages.dev
### 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.

4
package-lock.json generated
View file

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

View file

@ -44,7 +44,10 @@ function detectPackageManager(
if (existsSync(path.join(workingDirectory, "pnpm-lock.yaml"))) {
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 null;