Set up your GitHub Actions workflow with a specific version of Bun
Find a file
Jozef Steinhübl b3ee939183
ci: disable bun-version using commit
API must be fixed
2023-11-17 15:26:19 +01:00
.github/workflows ci: disable bun-version using commit 2023-11-17 15:26:19 +01:00
dist feat: merge local bunfig with action scope/registry config 2023-11-16 16:23:34 -03:00
src feat: merge local bunfig with action scope/registry config 2023-11-16 16:23:34 -03: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 feat: merge local bunfig with action scope/registry config 2023-11-16 16:23:34 -03:00
LICENSE chore: update package.json, license 2022-07-12 11:03:29 +02:00
package.json feat: merge local bunfig with action scope/registry config 2023-11-16 16:23:34 -03:00
README.md feat: merge local bunfig with action scope/registry config 2023-11-16 16:23:34 -03:00
tsconfig.json feat: merge local bunfig with action scope/registry config 2023-11-16 16:23:34 -03:00

setup-bun

Download, install, and setup Bun in GitHub Actions.

Usage

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

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

For better DX and not having to expose the Github Token locally and inside repo commits, it would be wise to remove any [install.scopes] from a local bunfig.toml and move it to a global config file, that way each developer will have it's own file, it's not exposed to the repo and it also makes sure that each developer can manage the expiration date.

About global config

- uses: oven-sh/setup-bun@main # Or release version greater than 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