setup-bun icon indicating copy to clipboard operation
setup-bun copied to clipboard

Put `bunfig.toml` in global directory

Open brettwillis opened this issue 1 year ago • 1 comments

Currently the auth tokens etc are written to a bunfig.toml file in the working directory. If the project is a monorepo and we run a bun install in a subdirectory, this config is not picked up.

If we can place the config in $HOME/.bunfig.toml then it would be picked up regardless of where we run bun install.

However I tried manually moving mv bunfig.toml $HOME/.bunfig.toml but bun still does not pick up the config. Could it be that bun does not expand the $BUN_AUTH_TOKEN env variable placeholder when it is in the global/home directory?

brettwillis avatar Aug 19 '24 10:08 brettwillis

I have run into a similar issue. I need to checkout multiple repos side by side and run bun install in both and some of the install happens from a private internal github repo.

I end up with this issue, due to the fact I have to copy the bunfig.toml to multiple locations or else I end up with 401's when I run bun install.

4 | '@videate' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/"}
                                                                                  ^
error: Cannot redefine key
    at /opt/actions-runner/_work/sidebar/sidebar/selectifier/bunfig.toml:4:79
SyntaxError: An error occurred while parsing code

videate-josh avatar Sep 18 '24 18:09 videate-josh