name: Supabase CLI Action description: Setup Supabase CLI, supabase, on GitHub Actions runners author: Supabase inputs: version: description: Version of Supabase CLI to install. If omitted, detect from the root lockfile and otherwise use latest. required: false github-token: description: GitHub token used to resolve the latest Supabase CLI release without hitting unauthenticated API limits. required: false outputs: version: description: Version of installed Supabase CLI value: ${{ steps.setup-cli.outputs.version }} runs: using: composite steps: - id: bun-download name: Resolve Bun Download URL shell: sh working-directory: ${{ github.action_path }} run: | set -eu if [ "${RUNNER_OS}" != "Linux" ]; then exit 0 fi # setup-bun does not detect Linux musl yet, so Alpine-like containers need the musl asset explicitly. is_musl=false if [ -f /etc/alpine-release ]; then is_musl=true elif command -v ldd >/dev/null 2>&1 && ldd --version 2>&1 | grep -qi musl; then is_musl=true fi if [ "${is_musl}" != "true" ]; then exit 0 fi version="$(cat .bun-version)" case "$(uname -m)" in x86_64) arch="x64" ;; aarch64|arm64) arch="aarch64" ;; *) echo "Unsupported Linux musl architecture: $(uname -m)" >&2 exit 1 ;; esac echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-${arch}-musl.zip" >> "$GITHUB_OUTPUT" - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version-file: ${{ github.action_path }}/.bun-version bun-download-url: ${{ steps.bun-download.outputs.url }} - name: Install Action Dependencies shell: sh working-directory: ${{ github.action_path }} run: bun install --frozen-lockfile --production - id: setup-cli name: Setup Supabase CLI shell: sh working-directory: ${{ github.action_path }} env: INPUT_VERSION: ${{ inputs.version }} SUPABASE_CLI_GITHUB_TOKEN: ${{ inputs.github-token }} run: bun src/main.ts