Skip to content

Commit

Permalink
Add auth setup for private registry with scope (#16)
Browse files Browse the repository at this point in the history
feat: add auth setup to private registry with scope
  • Loading branch information
vitoorgomes authored Nov 1, 2023
1 parent 6be8746 commit 830e319
Show file tree
Hide file tree
Showing 7 changed files with 26,815 additions and 7,288 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,31 @@ Download, install, and setup [Bun](https://bun.sh) in GitHub Actions.
bun-version: latest
```
### Setup custom registry-url and scope (for private packages)
```yaml
- 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
```yaml
- 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>` |
| 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

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ inputs:
description: 'The version of Bun to install. (e.g. "latest", "canary", "0.5.6", <sha>)'
default: latest
required: false
registry-url:
required: false
description: "Optional registry to set up for auth. Will set the registry in a project level build.toml file, and set up auth to read in from env.BUN_AUTH_TOKEN."
scope:
required: false
description: "Optional scope for authenticating against scoped registries."
outputs:
bun-version:
description: The version of Bun that was installed.
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Loading

0 comments on commit 830e319

Please sign in to comment.