Set up your GitHub Actions workflow with a specific version of Bun
Find a file
Vitor Gomes 830e319e28
Add auth setup for private registry with scope (#16)
feat: add auth setup to private registry with scope
2023-11-01 10:17:17 +01:00
.github/workflows feat: support packageManager in package.json (#27) 2023-10-25 15:13:22 +02:00
dist Add auth setup for private registry with scope (#16) 2023-11-01 10:17:17 +01:00
src Add auth setup for private registry with scope (#16) 2023-11-01 10:17:17 +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 Add auth setup for private registry with scope (#16) 2023-11-01 10:17:17 +01:00
bun.lockb Add auth setup for private registry with scope (#16) 2023-11-01 10:17:17 +01:00
LICENSE chore: update package.json, license 2022-07-12 11:03:29 +02:00
package.json feat: support packageManager in package.json (#27) 2023-10-25 15:13:22 +02:00
README.md Add auth setup for private registry with scope (#16) 2023-11-01 10:17:17 +01:00
tsconfig.json Next release of setup-bun 2023-02-22 17:47:24 -08:00

setup-bun

Download, install, and setup Bun in GitHub Actions.

Usage

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

Setup custom registry-url and scope (for private packages)

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

After setting up the registry-url and scope, when installing step comes, inject the env to authenticate and install all packages from the private registry

- name: Installing dependencies
  env:
    BUN_AUTH_TOKEN: ${{ secrets.MY_SUPER_SECRET_PAT }}
  run: bun i

Inputs

Name Description Default Examples
bun-version The version of Bun to download and install. latest canary, 1.0.0, <sha>
registry-url Registry URL where some private package is stored. undefined "https://npm.pkg.github.com/"
scope Scope for private pacakages undefined "@foo-bar", "@orgname"

Outputs

Name Description Example
cache-hit If the Bun executable was read from cache. true
bun-version The output from bun --version. 1.0.0
bun-revision The output from bun --revision. 1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983