feat: use packageManager from package.json as default bun version (#152)
* Initial plan * feat: make packageManager from package.json the default bun version Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> * test: improve cross-platform compatibility and cleanup in utils tests Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> * docs: update README to document automatic package.json version detection Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> * conflicts * ci: setup-bun-from-package-json-without-specified-field * ci: setup-bun-from-package-json-without-specified-field * ci: no cache --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> Co-authored-by: Jozef Steinhübl <contact@xhyrom.dev>
This commit is contained in:
30
README.md
30
README.md
@@ -4,6 +4,18 @@ Download, install, and setup [Bun](https://bun.sh) in GitHub Actions.
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
```
|
||||
|
||||
By default, if no version is specified, the action will:
|
||||
|
||||
1. Check `package.json` for the `packageManager` field (e.g., `"packageManager": "bun@1.0.25"`)
|
||||
2. If `packageManager` doesn't exist, check `package.json` for `engines.bun`
|
||||
3. If neither exists or `package.json` is not found, use `latest`
|
||||
|
||||
You can also explicitly specify a version:
|
||||
|
||||
```yaml
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
@@ -66,15 +78,15 @@ If you need to override the download URL, you can use the `bun-download-url` inp
|
||||
|
||||
## Inputs
|
||||
|
||||
| Name | Description | Default | Examples |
|
||||
| ------------------ | --------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------ |
|
||||
| `bun-version` | The version of Bun to download and install. | `latest` | `canary`, `1.0.0`, `1.0.x` |
|
||||
| `bun-version-file` | The version of Bun to download and install from file. | `undefined` | `package.json`, `.bun-version`, `.tool-versions` |
|
||||
| `bun-download-url` | URL to download .zip file for Bun release | | |
|
||||
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
|
||||
| `scope` | Scope for private packages. | `undefined` | `"@foo"`, `"@orgname"` |
|
||||
| `no-cache` | Disable caching of the downloaded executable. | `false` | `true`, `false` |
|
||||
| `token` | Personal access token (PAT) used to fetch tags from the `oven-sh/bun` repository. | `${{ github.token }}` | `${{ secrets.GITHUB_TOKEN }}` |
|
||||
| Name | Description | Default | Examples |
|
||||
| ------------------ | --------------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------ |
|
||||
| `bun-version` | The version of Bun to download and install. | Version from `package.json`, or `latest` | `canary`, `1.0.0`, `1.0.x` |
|
||||
| `bun-version-file` | The version of Bun to download and install from file. | `undefined` | `package.json`, `.bun-version`, `.tool-versions` |
|
||||
| `bun-download-url` | URL to download .zip file for Bun release | | |
|
||||
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
|
||||
| `scope` | Scope for private packages. | `undefined` | `"@foo"`, `"@orgname"` |
|
||||
| `no-cache` | Disable caching of the downloaded executable. | `false` | `true`, `false` |
|
||||
| `token` | Personal access token (PAT) used to fetch tags from the `oven-sh/bun` repository. | `${{ github.token }}` | `${{ secrets.GITHUB_TOKEN }}` |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user