Merge pull request #245 from Cherry/fix/packageManager

docs: remove warning about packageManager and pnpm default
This commit is contained in:
Igor Minar 2024-03-26 15:22:04 -07:00 committed by GitHub
commit fd98a7c990
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,6 @@ jobs:
- name: Deploy - name: Deploy
uses: cloudflare/wrangler-action@v3 uses: cloudflare/wrangler-action@v3
with: with:
packageManager: pnpm # you can omit this if you use npm
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
``` ```
@ -53,10 +52,6 @@ jobs:
## Configuration ## Configuration
### packageManager
⚠️ you must specify package manager. If not specified GH action assumes you are using npm and other managers might be failing. For example pnpm will fail with: `Cannot read properties of null (reading 'matches')`
If you need to install a specific version of Wrangler to use for deployment, you can also pass the input `wranglerVersion` to install a specific version of Wrangler from NPM. This should be a [SemVer](https://semver.org/)-style version number, such as `2.20.0`: If you need to install a specific version of Wrangler to use for deployment, you can also pass the input `wranglerVersion` to install a specific version of Wrangler from NPM. This should be a [SemVer](https://semver.org/)-style version number, such as `2.20.0`:
```yaml ```yaml
@ -273,6 +268,22 @@ The resulting output will look something like this:
https://<your_pages_site>.pages.dev 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.
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.
```yaml
jobs:
deploy:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
packageManager: pnpm
```
## Troubleshooting ## Troubleshooting
### "I just started using Workers/Wrangler and I don't know what this is!" ### "I just started using Workers/Wrangler and I don't know what this is!"