chore: prepare for v2.0.0 (#405)

## Summary

This PR prepares `supabase/setup-cli` for `v2.0.0`.

The main goal of this release is to simplify the action and modernize
the repo/tooling around a Bun-based implementation, while tightening
workflows, tests, and documentation.

## What Changed

### Action runtime
- switched the action from a Node/compiled `dist` runtime to a Bun-based
composite action
- removed the checked-in `dist/` output entirely
- simplified the action source down to a single runtime file in
`src/main.ts`
- kept the public action interface the same:
  - `with.version`
  - `outputs.version`

### Tooling
- switched package management and local tooling from npm to Bun
- removed Rollup and the build step
- replaced Jest with Bun’s native test runner
- replaced Prettier with `oxfmt`
- replaced ESLint with `oxlint`
- enabled type-aware/type-check linting with `oxlint-tsgolint`
- simplified TypeScript config to a single `tsconfig.json` extending
`@tsconfig/bun`

### Tests
- moved tests next to the runtime source
- rewrote tests to focus on meaningful user-facing action behavior
- added coverage for:
  - default entrypoint execution
  - latest version installs
  - legacy version installs
  - modern pinned version installs
  - failure when the installed CLI cannot report a version
- action code coverage is now `100%`

### Workflows
- renamed workflow files for clarity:
  - `test.yml` -> `ci.yml`
  - `start.yml` -> `e2e.yml`
- updated workflow/job naming so required checks are clean and stable:
  - `CI`
  - `E2E`
  - `CodeQL`
  - `Licensed`
- added aggregate PR-facing checks so branch protection does not need
matrix legs
- made CI and E2E skip heavy jobs on draft PRs
- made E2E run automatically on ready PRs and new commits
- simplified CodeQL config by removing the separate config file
- updated action pins to current releases using commit SHAs
- refined Dependabot for Bun-era updates and non-major auto-merge

### Docs
- refreshed `README.md` and `docs/index.md` for the new v2 behavior
- updated examples to use `@v2`
- added a practical example for exporting local Supabase env vars after
`supabase start`
- removed stale references to old local/dev flows

## Breaking / Notable Changes

- the action now runs as a Bun-based composite action instead of a
prebuilt JavaScript action
- no checked-in `dist/` artifacts anymore
- self-hosted runners now need the prerequisites expected by the
composite action path:
  - `bash`
- network access to install Bun/dependencies and download the Supabase
CLI

## Validation

Verified locally with:
- `bun run format:check`
- `bun run lint`
- `bun test`
- `bun run ci`

Also updated workflows and branch-protection-friendly check names so PR
validation is cleaner going forward.

## Follow-up

After merge, branch protection should require only:
- `CI`
- `E2E`
- `CodeQL`
- `Licensed`

---------

Co-authored-by: licensed-ci <licensed-ci@users.noreply.github.com>
This commit is contained in:
Julien Goux
2026-04-03 17:51:37 +02:00
committed by GitHub
parent 60645042c4
commit 2eca1b4d35
52 changed files with 1262 additions and 46740 deletions

View File

@@ -1,42 +1,43 @@
# `supabase-github-action`
# `supabase/setup-cli`
The Supabase GitHub Action provides an easy way to use the Supabase CLI on
GitHub's hosted Actions runners.
The Supabase CLI Action provides an easy way to install the
[Supabase CLI](https://github.com/supabase/cli) on GitHub Actions runners.
The action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest`
GitHub Actions runners, and will install and expose a specified version of the
Supabase CLI on the runner environment.
The action supports `ubuntu-latest`, `windows-latest`, and `macos-latest`, and
adds the requested `supabase` version to `PATH` for the rest of the job.
## Quick start
If `version` is omitted, the action checks the repository root for `bun.lock`,
`pnpm-lock.yaml`, or `package-lock.json` and otherwise falls back to `latest`.
This example shows how you can use the Supabase GitHub Action to test your
migrations on every Pull Request.
## Quick Start
Inside your repository, create a new file inside the `.github/workflows` folder
called `test-migrations.yml`.
Copy this snippet inside the file, and the action will run whenever a new PR is
created:
This example runs Supabase migrations on every pull request:
```yaml
name: 'test-migrations'
name: test-migrations
on:
pull_request:
jobs:
build:
test-migrations:
runs-on: ubuntu-latest
steps:
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase init
- run: supabase db start
- uses: actions/checkout@v6
- uses: supabase/setup-cli@v2
- run: supabase init
- run: supabase db start
```
To pin a specific CLI version:
```yaml
- uses: supabase/setup-cli@v2
with:
version: 2.84.2
```
## Resources
- **Source Code**:
<a href="https://github.com/supabase/supabase-github-action" target="_blank">github.com/supabase/supabase-github-action</a>
- **CLI Documentation**:
<a href="https://supabase.com/docs/guides/cli" target="_blank">supabase.com/docs/guides/cli</a>
- **Source Code**: <https://github.com/supabase/setup-cli>
- **CLI Documentation**: <https://supabase.com/docs/guides/cli>