mirror of
https://github.com/supabase/setup-cli.git
synced 2026-06-28 01:46:58 +00:00
fix: authenticate latest release lookup (#430)
## Summary
- Add an optional `github-token` input to authenticate the GitHub
release lookup used by `version: latest`.
- Pass the token through the composite action as
`SUPABASE_CLI_GITHUB_TOKEN` and use it as a bearer token for the
`/repos/supabase/cli/releases/latest` request.
- Update this repository's CI smoke test and README examples to pass
`${{ github.token }}` when testing or using `latest`.
## Root Cause
CI failed in `test (macos-latest, latest)` because the action resolved
`latest` through an unauthenticated GitHub REST API request and hit the
low unauthenticated rate limit. The dependency bump in #429 was not the
cause; the validate job passed and the failure happened inside the
release lookup path.
## Impact
Pinned versions continue to work without a token. For `version: latest`,
callers can now pass `${{ github.token }}` to avoid unauthenticated API
rate limiting while keeping the input optional for backward
compatibility.
## Validation
- `bun run ci`
This commit is contained in:
@@ -47,6 +47,7 @@ steps:
|
||||
- uses: supabase/setup-cli@v2
|
||||
with:
|
||||
version: latest
|
||||
github-token: ${{ github.token }}
|
||||
- run: supabase init
|
||||
- run: supabase db start
|
||||
```
|
||||
@@ -58,9 +59,10 @@ on Windows and macOS runners.
|
||||
|
||||
The action supports the following inputs:
|
||||
|
||||
| Name | Type | Description | Default | Required |
|
||||
| --------- | ------ | ---------------------------------- | --------------------------------- | -------- |
|
||||
| `version` | String | Supabase CLI version (or `latest`) | Root lockfile version or `latest` | false |
|
||||
| Name | Type | Description | Default | Required |
|
||||
| -------------- | ------ | -------------------------------------------------------------------------- | --------------------------------- | -------- |
|
||||
| `version` | String | Supabase CLI version (or `latest`) | Root lockfile version or `latest` | false |
|
||||
| `github-token` | String | GitHub token used to resolve `latest` without unauthenticated API limiting | | false |
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
@@ -162,6 +164,7 @@ steps:
|
||||
- uses: ./
|
||||
with:
|
||||
version: latest
|
||||
github-token: ${{ github.token }}
|
||||
```
|
||||
|
||||
The CI workflow provides fast smoke coverage across GitHub-hosted runners, and
|
||||
|
||||
Reference in New Issue
Block a user