File tree Expand file tree Collapse file tree
.github/actions/setup-bun Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 steps :
66 - name : Setup Bun
77 uses : oven-sh/setup-bun@v2
8+ with :
9+ bun-version-file : package.json
810
911 - name : Cache ~/.bun
1012 id : cache-bun
Original file line number Diff line number Diff line change 11import { $ } from "bun"
2+ import path from "path"
23
3- if ( process . versions . bun !== "1.3.1" ) {
4- throw new Error ( "This script requires bun@1.3.1" )
4+ const rootPkgPath = path . resolve ( import . meta. dir , "../../../package.json" )
5+ const rootPkg = await Bun . file ( rootPkgPath ) . json ( )
6+ const expectedBunVersion = rootPkg . packageManager ?. split ( "@" ) [ 1 ]
7+
8+ if ( ! expectedBunVersion ) {
9+ throw new Error ( "packageManager field not found in root package.json" )
10+ }
11+
12+ if ( process . versions . bun !== expectedBunVersion ) {
13+ throw new Error (
14+ `This script requires bun@${ expectedBunVersion } , but you are using bun@${ process . versions . bun } ` ,
15+ )
516}
617
718const CHANNEL =
You can’t perform that action at this time.
0 commit comments