Set up your GitHub Actions workflow with a specific version of Bun
Find a file
Jozef Steinhübl 56408e9a3f
release: v2.0.2
2025-04-27 15:47:24 +02:00
.github ci: remove unnecessary steps & cleanup (#118) 2025-02-04 18:31:38 +01:00
dist build: bump @actions/cache version (#128) 2025-04-27 15:46:35 +02:00
src fix: make bun resolve to given file path when an absolute path is given (#114) 2024-12-09 18:46:15 +01:00
.gitattributes Fix bunx (#18) 2023-09-11 12:37:45 -07:00
.gitignore Fix bunx (#18) 2023-09-11 12:37:45 -07:00
action.yml ci: remove unnecessary steps & cleanup (#118) 2025-02-04 18:31:38 +01:00
bun.lock build: use text-based Bun lockfile (#116) 2025-01-05 12:45:22 +01:00
bunfig.toml build: use text-based Bun lockfile (#116) 2025-01-05 12:45:22 +01:00
LICENSE chore: update package.json, license 2022-07-12 11:03:29 +02:00
package-lock.json build: bump @actions/cache version (#128) 2025-04-27 15:46:35 +02:00
package.json release: v2.0.2 2025-04-27 15:47:24 +02:00
README.md chore(docs): missing version on examples (#96) 2024-08-06 11:21:46 +02:00
tsconfig.json Various improvements and fixes to setup-bun (#40) 2023-11-17 15:58:17 -08:00

setup-bun

Download, install, and setup Bun in GitHub Actions.

Usage

- uses: oven-sh/setup-bun@v2
  with:
    bun-version: latest

Using version file

- uses: oven-sh/setup-bun@v2
  with:
    bun-version-file: ".bun-version"

Using a custom NPM registry

- uses: oven-sh/setup-bun@v2
  with:
    registry-url: "https://npm.pkg.github.com/"
    scope: "@foo"

If you need to authenticate with a private registry, you can set the BUN_AUTH_TOKEN environment variable.

- name: Install Dependencies
  env:
    BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  run: bun install --frozen-lockfile

Override download url

If you need to override the download URL, you can use the bun-download-url input.

- uses: oven-sh/setup-bun@v2
  with:
    bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip"

Node.js not needed

In most cases, you shouldn't need to use the setup-node GitHub Action.

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"

Outputs

Name Description Example
bun-version The output from bun --version. 1.0.0
bun-revision The output from bun --revision. 1.0.0+822a00c4
bun-path The path to the Bun executable. /path/to/bun
bun-download-url The URL from which Bun was downloaded. https://bun.sh/download/latest/linux/x64?avx2=true&profile=false
cache-hit If the Bun executable was read from cache. true