Skip to content

ci: auto-bump Homebrew formula on CLI release#3306

Merged
saddlepaddle merged 5 commits into
mainfrom
saddlepaddle/homebrew-bump
Apr 9, 2026
Merged

ci: auto-bump Homebrew formula on CLI release#3306
saddlepaddle merged 5 commits into
mainfrom
saddlepaddle/homebrew-bump

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Apr 9, 2026

Summary

Adds a GitHub Actions workflow that auto-updates the `superset-sh/homebrew-tap` repository whenever a CLI release is published.

Flow:

  1. User pushes a `cli-v*` tag → existing `build-cli.yml` builds tarballs and creates a draft release (from PR feat(cli): standalone distribution with embedded host-service #3298)
  2. User publishes the draft
  3. This workflow triggers on `release.published`
  4. Downloads each platform tarball, computes SHA256
  5. Rewrites `Formula/superset.rb` with the new version and SHAs
  6. Pushes to `superset-sh/homebrew-tap` main

After that, users can install via:
```bash
brew install superset-sh/tap/superset
```

Setup required before this lands

  • `superset-sh/homebrew-tap` repo created with initial formula scaffolding
  • `HOMEBREW_TAP_TOKEN` secret added to `superset-sh/superset` — needs to be a GitHub PAT (fine-grained or classic) with `contents: write` access to `superset-sh/homebrew-tap`

Test plan

Depends on


Summary by cubic

Automates Homebrew formula bumps on CLI releases and adds a one-line installer. Improves reliability with stricter workflows and fixes installer output handling and binary verification.

  • New Features

    • Auto-bump on release.published for cli-v*: compute SHA256 for darwin-arm64, darwin-x64, linux-x64, update Formula/superset.rb, push to superset-sh/homebrew-tap.
    • Installer at https://superset.sh/cli/install.sh: detects macOS arm64/x64 and Linux x64, installs to ~/superset or $SUPERSET_HOME, updates PATH, supports SUPERSET_VERSION.
    • Tarballs now extract directly into the install dir (no top-level wrapper).
  • Bug Fixes

    • Installer sends info/warn to stderr and requires binaries to be regular executable files.
    • Hardened bump workflow: strict shell, temp-file downloads with exit checks, tag regex validation via env injection, formula rendering via python3, concurrency group, and push retry with rebase.

Written for commit 6b1340f. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added a POSIX installer that downloads and installs the Superset CLI, updates the user PATH across common shells, and provides post-install instructions.
  • Chores

    • Added an automated workflow to update the Homebrew formula when CLI releases are published.
    • Fixed CLI packaging so released tarballs extract into the correct install layout (no extra top-level nesting).

When a cli-v* tag is published as a GitHub Release:
1. Compute SHA256 for each platform tarball
2. Rewrite Formula/superset.rb with the new version and SHAs
3. Push to superset-sh/homebrew-tap

Requires a HOMEBREW_TAP_TOKEN secret (GitHub PAT with repo access
to superset-sh/homebrew-tap).
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 227613f2-99ea-4932-ad95-b419e621445b

📥 Commits

Reviewing files that changed from the base of the PR and between 17794c3 and 6b1340f.

📒 Files selected for processing (1)
  • apps/marketing/public/cli/install.sh

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow to bump a Homebrew tap on cli-v* releases, adds a POSIX installer script to download/extract platform CLI tarballs and update shell profiles, and changes tarball packaging to archive staging contents directly.

Changes

Cohort / File(s) Summary
Homebrew Release Automation
​.github/workflows/bump-homebrew.yml
New workflow triggered on release.published for tags starting with cli-v. Validates tag, extracts version, downloads darwin-arm64 / darwin-x64 / linux-x64 tarballs, computes SHA256s, checks out superset-sh/homebrew-tap, renders Formula/superset.rb with version and per-platform checksums, and commits/pushes only if changed (retries push after git pull --rebase).
CLI Installer
apps/marketing/public/cli/install.sh
New POSIX sh installer (set -eu) that detects OS/arch (darwin-arm64, darwin-x64, linux-x64), chooses SUPERSET_VERSION or latest, downloads superset-<target>.tar.gz, extracts into $SUPERSET_HOME (default ~/superset), verifies bin/superset and bin/superset-host, and updates the user shell profile to prepend <install>/bin while avoiding duplicate PATH entries.
Tarball layout change
packages/cli/scripts/build-dist.ts
Packaging change: archives are now created from inside the staging root (-C stagingRoot .) instead of wrapping contents under a superset-<target>/ top-level directory, changing extraction path structure.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Release as GitHub Release
  participant Actions as GitHub Actions Runner
  participant Artifacts as Superset Release Assets
  participant Tap as Homebrew Tap Repo

  Release->>Actions: release.published (tag cli-v*)
  Actions->>Actions: validate tag & extract version
  Actions->>Artifacts: download darwin-arm64 / darwin-x64 / linux-x64 tarballs
  Artifacts-->>Actions: return tarball files
  Actions->>Actions: compute SHA256s
  Actions->>Tap: checkout/clone tap using token
  Actions->>Tap: render/overwrite Formula/superset.rb (version + SHA256s)
  Actions->>Tap: commit & push (retry: git pull --rebase && push)
  Tap-->>Actions: push result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped on a tag and fetched three crates,

counted crumbs of checksum with tidy pate,
I wrote a formula and gave it a shove,
an installer burrowed a PATH to love.
Cheers — a carrot-sized build well made!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci: auto-bump Homebrew formula on CLI release' clearly and concisely summarizes the main change: automating Homebrew formula updates on CLI releases via a GitHub Actions workflow.
Description check ✅ Passed The PR description is comprehensive, covering the workflow summary, setup requirements, test plan, dependencies, and additional context from the auto-generated summary by cubic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch saddlepaddle/homebrew-bump

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 9, 2026

Greptile Summary

This PR adds .github/workflows/bump-homebrew.yml, a GitHub Actions workflow that fires on release.published for cli-v* tags, downloads the platform tarballs, computes SHA256 checksums, rewrites Formula/superset.rb in the superset-sh/homebrew-tap repository, and pushes the result. The approach is solid overall, but two correctness/security issues need to be addressed before this is safe to ship:

  • Silent wrong-SHA bug: The curl | shasum pipeline runs without set -o pipefail, so a curl failure (404, network error) produces the SHA256 of empty input rather than failing the step — the if [ -z \"$sha\" ] guard is bypassed and a bogus checksum is committed to the tap.
  • Script-injection risk: ${{ github.event.release.tag_name }} is spliced directly into the shell script in the "Extract version" step instead of being passed through an env: variable, which is the pattern already used correctly in the next step.
  • Formula indentation: The heredoc inside the YAML run: block inherits 10 spaces of YAML indentation on every line of the output file, which will cause brew audit --strict to flag style errors.

Confidence Score: 3/5

Not safe to merge until the pipe-failure bug and script-injection issue are fixed; both are straightforward one-line corrections.

Two P1 issues: (1) missing pipefail means a failed tarball download silently writes a wrong SHA to the formula — every user's brew install would break without any CI signal; (2) direct ${{ }} interpolation in a shell run step is a documented script-injection vector with the HOMEBREW_TAP_TOKEN secret in scope. Both are trivial to fix but material enough to block merge. The formula indentation issue is a P2 that would surface in brew audit but won't block installation.

.github/workflows/bump-homebrew.yml — all three issues are in this single file.

Vulnerabilities

  • Script injection (.github/workflows/bump-homebrew.yml, line 19): ${{ github.event.release.tag_name }} is interpolated directly into the shell script body rather than being passed via an env: variable. A maliciously crafted tag name could inject arbitrary shell commands into the runner. The HOMEBREW_TAP_TOKEN secret would be accessible from within the same job, making exfiltration trivial. Fix: use env: TAG: ${{ github.event.release.tag_name }} and reference $TAG in the script.
  • No hardcoded secrets or credentials found.
  • The HOMEBREW_TAP_TOKEN secret is consumed correctly through ${{ secrets.HOMEBREW_TAP_TOKEN }} and scoped only to the checkout step.

Important Files Changed

Filename Overview
.github/workflows/bump-homebrew.yml New CI workflow that auto-bumps the Homebrew tap on CLI release publication; has a P1 pipe-failure bug that silently writes a wrong SHA, a P1 script-injection risk in the tag extraction step, and a P2 formula indentation issue from the heredoc inside a YAML block.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub (superset-sh/superset)
    participant Workflow as bump-homebrew.yml
    participant Releases as GitHub Releases CDN
    participant Tap as superset-sh/homebrew-tap

    Dev->>GH: Push cli-v* tag
    GH->>GH: build-cli.yml builds tarballs & creates draft release
    Dev->>GH: Publish draft release
    GH->>Workflow: release.published event (tag starts with cli-v)
    Workflow->>Workflow: Extract version from tag
    loop for each platform tarball
        Workflow->>Releases: curl download tarball
        Releases-->>Workflow: tarball bytes
        Workflow->>Workflow: shasum -a 256 → SHA256
    end
    Workflow->>Tap: checkout via HOMEBREW_TAP_TOKEN
    Workflow->>Tap: Rewrite Formula/superset.rb (version + SHAs)
    Workflow->>Tap: git commit & push
    Note over Tap: brew install superset-sh/tap/superset now works
Loading

Reviews (1): Last reviewed commit: "ci: auto-bump Homebrew formula on CLI re..." | Re-trigger Greptile

Comment thread .github/workflows/bump-homebrew.yml Outdated
Comment on lines +32 to +34
sha=$(curl -fsSL "$url" | shasum -a 256 | awk '{print $1}')
if [ -z "$sha" ]; then
echo "::error::Failed to compute SHA for $target"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Pipe failure silently produces wrong SHA

Without set -o pipefail, a curl failure (e.g. 404 because the tarball hasn't been attached yet, or a network error) doesn't terminate the script. shasum still receives empty input and emits e3b0c44298fc1c149afbf4c8996fb92427ae41e4 — the SHA256 of zero bytes — which is non-empty, so the if [ -z "$sha" ] guard on line 33 is bypassed. The formula would be updated with a bogus checksum and brew install would fail for every user.

Add set -euo pipefail at the top of this step's run block:

Suggested change
sha=$(curl -fsSL "$url" | shasum -a 256 | awk '{print $1}')
if [ -z "$sha" ]; then
echo "::error::Failed to compute SHA for $target"
run: |
set -euo pipefail
for target in darwin-arm64 darwin-x64 linux-x64; do
url="https://github.com/superset-sh/superset/releases/download/${TAG}/superset-${target}.tar.gz"
echo "Fetching SHA for $url"
sha=$(curl -fsSL "$url" | shasum -a 256 | awk '{print $1}')
if [ -z "$sha" ]; then
echo "::error::Failed to compute SHA for $target"
exit 1
fi
echo "${target//-/_}_sha=$sha" >> "$GITHUB_OUTPUT"
done

With pipefail, if curl returns a non-zero exit code (e.g. 22 for 404), the entire pipeline fails immediately and the if [ -z "$sha" ] branch becomes a useful secondary guard for any remaining edge cases.

Comment on lines +18 to +22
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#cli-v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Script injection via tag name

${{ github.event.release.tag_name }} is interpolated directly into the shell script by the Actions runner before the shell parses it. If a tag name were crafted with shell metacharacters (e.g. a backtick, $(...), or a double-quote), it could execute arbitrary code in the runner. GitHub's own security hardening guide explicitly flags this pattern as a script-injection vector.

The fix is to pass context values through an env: block so they arrive as environment variables — not as literal text spliced into the script:

Suggested change
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#cli-v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Extract version from tag
id: version
env:
TAG: ${{ github.event.release.tag_name }}
run: |
VERSION="${TAG#cli-v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"

This change is low-risk (git tags are restricted in practice) but it's a well-established best practice and keeps the workflow consistent with the shas step below, which already uses env: correctly.

Comment thread .github/workflows/bump-homebrew.yml Outdated
Comment on lines +55 to +90
cat > Formula/superset.rb <<EOF
class Superset < Formula
desc "CLI and host-service for Superset"
homepage "https://superset.sh"
version "${VERSION}"
license "MIT"

on_macos do
on_arm do
url "https://github.com/superset-sh/superset/releases/download/cli-v#{version}/superset-darwin-arm64.tar.gz"
sha256 "${DARWIN_ARM64_SHA}"
end
on_intel do
url "https://github.com/superset-sh/superset/releases/download/cli-v#{version}/superset-darwin-x64.tar.gz"
sha256 "${DARWIN_X64_SHA}"
end
end

on_linux do
on_intel do
url "https://github.com/superset-sh/superset/releases/download/cli-v#{version}/superset-linux-x64.tar.gz"
sha256 "${LINUX_X64_SHA}"
end
end

def install
libexec.install Dir["*"]
bin.install_symlink libexec/"bin/superset"
bin.install_symlink libexec/"bin/superset-host"
end

test do
assert_match "superset", shell_output("#{bin}/superset --version")
end
end
EOF
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Heredoc inherits YAML indentation, producing a malformed formula

The cat <<EOF block sits inside the YAML run: block at 10 spaces of indentation. Because heredoc content is captured verbatim (and <<-EOF only strips tabs, not spaces), every line of the resulting Formula/superset.rb will start with 10 extra leading spaces. While Ruby itself doesn't care about indentation, brew audit --strict (which Homebrew runs on tap formulas during CI) will reject non-standard whitespace and flag style errors.

The simplest fix is to strip the leading whitespace with sed after writing:

          cat > Formula/superset.rb <<EOF
          class Superset < Formula
            ...
          end
          EOF
          # Strip the leading indentation added by the YAML block
          sed -i 's/^          //' Formula/superset.rb

Alternatively, extract the formula template into a separate file (e.g. .github/formula-template.rb) and use envsubst or sed substitutions — this keeps the YAML readable and the formula correctly formatted.

One-liner install for the CLI distribution:

  curl -fsSL https://superset.sh/cli/install.sh | sh

- Detects platform/arch (macOS arm64/x64, Linux x64)
- Downloads latest release tarball from GitHub
- Extracts to ~/superset/ (or $SUPERSET_HOME)
- Adds ~/superset/bin to PATH in the user's shell profile
- Respects SUPERSET_VERSION for pinned installs

Also: tarball no longer has a top-level superset-<target>/ wrapper,
so `tar -xzf ... -C ~/superset` drops contents directly.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/bump-homebrew.yml:
- Around line 11-15: The bump job's push step currently does a straight git push
which can silently drop a release bump if two runs overlap; update the bump job
(the steps under jobs.bump that perform the git commit/push) to fetch the remote
branch and perform a git pull --rebase (or git fetch + git rebase
origin/<branch>) immediately before pushing, and wrap the push in a retry that
will re-fetch/rebase and re-apply the commit if a non-fast-forward error occurs
so concurrent runs serialize and don't lose updates.
- Around line 24-38: Add robust failure handling to the SHA computation step:
enable strict bash mode by adding set -euo pipefail at the top of the run block,
download each release artifact into a temporary file (e.g., using mktemp)
instead of piping directly into shasum, validate the downloaded file size is
non-zero (fail with an error if it is), compute the SHA256 from that file and
then write the result to GITHUB_OUTPUT using the same variable name pattern
(${target//-/_}_sha); ensure temporary files are removed after use.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc89c1a3-3ea1-4a8a-8fcb-cfd66f1f9993

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab64a7 and 7d56677.

📒 Files selected for processing (1)
  • .github/workflows/bump-homebrew.yml

Comment thread .github/workflows/bump-homebrew.yml
Comment thread .github/workflows/bump-homebrew.yml
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) View App
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

- Add set -euo pipefail to all run blocks
- Curl to tempfile + check exit status instead of piping to shasum
  (pipes without pipefail mask curl failures and produce the
  empty-input SHA256)
- Inject tag via env: instead of direct ${{ }} interpolation to
  prevent script injection via malicious tag names. Validate tag
  format with regex before use.
- Render formula via python3 reading from env, eliminating YAML+shell
  heredoc indentation pitfalls
- Add concurrency group to serialize concurrent release publishes
- Retry push once with rebase as belt-and-suspenders
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/bump-homebrew.yml">

<violation number="1" location=".github/workflows/bump-homebrew.yml:19">
P1: `${{ github.event.release.tag_name }}` is interpolated directly into the shell script by the Actions runner before the shell parses it. A tag name with shell metacharacters (backticks, `$(...)`, etc.) could execute arbitrary code. Pass it through an `env:` block instead, matching the pattern already used in the `shas` step below.</violation>

<violation number="2" location=".github/workflows/bump-homebrew.yml:32">
P0: Without `set -o pipefail`, a `curl` failure (e.g., 404 for a missing tarball) is masked by the pipeline — `shasum` hashes the empty stdin and produces `e3b0c44298fc1c149afbf4c8996fb924...`, which is non-empty, so the `[ -z "$sha" ]` guard on the next line is silently bypassed. The formula would be pushed with a bogus checksum, breaking `brew install` for every user.

Add `set -euo pipefail` at the top of this step's `run:` block so any upstream pipe failure terminates the script immediately.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread .github/workflows/bump-homebrew.yml Outdated
for target in darwin-arm64 darwin-x64 linux-x64; do
url="https://github.com/superset-sh/superset/releases/download/${TAG}/superset-${target}.tar.gz"
echo "Fetching SHA for $url"
sha=$(curl -fsSL "$url" | shasum -a 256 | awk '{print $1}')
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: Without set -o pipefail, a curl failure (e.g., 404 for a missing tarball) is masked by the pipeline — shasum hashes the empty stdin and produces e3b0c44298fc1c149afbf4c8996fb924..., which is non-empty, so the [ -z "$sha" ] guard on the next line is silently bypassed. The formula would be pushed with a bogus checksum, breaking brew install for every user.

Add set -euo pipefail at the top of this step's run: block so any upstream pipe failure terminates the script immediately.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/bump-homebrew.yml, line 32:

<comment>Without `set -o pipefail`, a `curl` failure (e.g., 404 for a missing tarball) is masked by the pipeline — `shasum` hashes the empty stdin and produces `e3b0c44298fc1c149afbf4c8996fb924...`, which is non-empty, so the `[ -z "$sha" ]` guard on the next line is silently bypassed. The formula would be pushed with a bogus checksum, breaking `brew install` for every user.

Add `set -euo pipefail` at the top of this step's `run:` block so any upstream pipe failure terminates the script immediately.</comment>

<file context>
@@ -0,0 +1,105 @@
+          for target in darwin-arm64 darwin-x64 linux-x64; do
+            url="https://github.com/superset-sh/superset/releases/download/${TAG}/superset-${target}.tar.gz"
+            echo "Fetching SHA for $url"
+            sha=$(curl -fsSL "$url" | shasum -a 256 | awk '{print $1}')
+            if [ -z "$sha" ]; then
+              echo "::error::Failed to compute SHA for $target"
</file context>
Fix with Cubic

Comment thread .github/workflows/bump-homebrew.yml Outdated
Comment on lines +19 to +24
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#cli-v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"

- name: Compute SHA256 for each tarball
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: ${{ github.event.release.tag_name }} is interpolated directly into the shell script by the Actions runner before the shell parses it. A tag name with shell metacharacters (backticks, $(...), etc.) could execute arbitrary code. Pass it through an env: block instead, matching the pattern already used in the shas step below.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/bump-homebrew.yml, line 19:

<comment>`${{ github.event.release.tag_name }}` is interpolated directly into the shell script by the Actions runner before the shell parses it. A tag name with shell metacharacters (backticks, `$(...)`, etc.) could execute arbitrary code. Pass it through an `env:` block instead, matching the pattern already used in the `shas` step below.</comment>

<file context>
@@ -0,0 +1,105 @@
+      - name: Extract version from tag
+        id: version
+        run: |
+          TAG="${{ github.event.release.tag_name }}"
+          VERSION="${TAG#cli-v}"
+          echo "version=$VERSION" >> "$GITHUB_OUTPUT"
</file context>
Suggested change
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#cli-v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Compute SHA256 for each tarball
- name: Extract version from tag
id: version
env:
TAG: ${{ github.event.release.tag_name }}
run: |
VERSION="${TAG#cli-v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
Fix with Cubic

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/marketing/public/cli/install.sh`:
- Around line 60-67: The download_tarball function is emitting the info log to
stdout which contaminates the command-substitution result; change the info
logging in download_tarball so it writes to stderr (e.g., have info stdout
redirected to stderr or call a variant that logs to >&2) while keeping the final
echo "$tmp" on stdout, and ensure the error path also logs to stderr (error
messages already should go to stderr) so that the command substitution capturing
the tarball path (tarball="$(download_tarball ... )") receives only the file
path.
- Line 137: Don't silently ignore chmod failures on the expected binaries;
instead check for the presence and executability of "$INSTALL_DIR/bin/superset"
and "$INSTALL_DIR/bin/superset-host" before or after trying to set permissions
(the current chmod line with 2>/dev/null || true hides real problems). Update
the install script to test -f or -x those paths (using INSTALL_DIR and the
"$INSTALL_DIR/bin/..." names) and if either is missing or not made executable,
emit an error message and exit non‑zero so the installer doesn't print
"Installed!" on a broken extraction; only run chmod when the files exist and
verify chmod succeeded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e71ed5ca-3620-470e-93e5-ba14a572e465

📥 Commits

Reviewing files that changed from the base of the PR and between 7d56677 and 9a0fcc8.

📒 Files selected for processing (3)
  • .github/workflows/bump-homebrew.yml
  • apps/marketing/public/cli/install.sh
  • packages/cli/scripts/build-dist.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/bump-homebrew.yml

Comment thread apps/marketing/public/cli/install.sh
Comment thread apps/marketing/public/cli/install.sh Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/marketing/public/cli/install.sh">

<violation number="1" location="apps/marketing/public/cli/install.sh:60">
P1: `info` writes to stdout, but `download_tarball` is invoked via command substitution (`tarball="$(download_tarball ...)"`) on line 135, so the log line gets captured into `$tarball` along with the temp path. This corrupts the filename and causes `tar -xzf` to fail every time. Redirect `info` to stderr here: `info "Downloading $url" >&2`.</violation>

<violation number="2" location="apps/marketing/public/cli/install.sh:137">
P2: Do not swallow `chmod` failures; this can produce a false “Installed!” result when binaries are missing or not executable.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/marketing/public/cli/install.sh
Comment thread apps/marketing/public/cli/install.sh Outdated
info() wrote to stdout, corrupting command substitution in
tarball="$(download_tarball ...)". Redirect both info and warn to
stderr. Replace silent `chmod ... || true` with an executable
verification loop so a broken tarball fails loudly.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/marketing/public/cli/install.sh`:
- Around line 139-143: The loop that checks each binary currently uses only the
`-x` test (in the for loop over `bin` using the `path` variable), which can be
true for directories; update the condition so it requires both a regular file
and executable permission by checking both `-f` and `-x` for `"$path"` before
calling `error`; modify the `if [ ! -x "$path" ]; then` branch to fail when
either check is missing (i.e., ensure `"$path"` is a regular file and is
executable) and keep using the existing `error` function for reporting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a7b04b0-1ca2-48c7-8029-d9824c9411f8

📥 Commits

Reviewing files that changed from the base of the PR and between 9a0fcc8 and 17794c3.

📒 Files selected for processing (1)
  • apps/marketing/public/cli/install.sh

Comment thread apps/marketing/public/cli/install.sh
@saddlepaddle saddlepaddle merged commit a876354 into main Apr 9, 2026
7 of 8 checks passed
MocA-Love pushed a commit to MocA-Love/superset that referenced this pull request Apr 10, 2026
* ci: auto-bump Homebrew formula on CLI release

When a cli-v* tag is published as a GitHub Release:
1. Compute SHA256 for each platform tarball
2. Rewrite Formula/superset.rb with the new version and SHAs
3. Push to superset-sh/homebrew-tap

Requires a HOMEBREW_TAP_TOKEN secret (GitHub PAT with repo access
to superset-sh/homebrew-tap).

* feat: add install script at superset.sh/cli/install.sh

One-liner install for the CLI distribution:

  curl -fsSL https://superset.sh/cli/install.sh | sh

- Detects platform/arch (macOS arm64/x64, Linux x64)
- Downloads latest release tarball from GitHub
- Extracts to ~/superset/ (or $SUPERSET_HOME)
- Adds ~/superset/bin to PATH in the user's shell profile
- Respects SUPERSET_VERSION for pinned installs

Also: tarball no longer has a top-level superset-<target>/ wrapper,
so `tar -xzf ... -C ~/superset` drops contents directly.

* fix: address PR review findings on bump-homebrew workflow

- Add set -euo pipefail to all run blocks
- Curl to tempfile + check exit status instead of piping to shasum
  (pipes without pipefail mask curl failures and produce the
  empty-input SHA256)
- Inject tag via env: instead of direct ${{ }} interpolation to
  prevent script injection via malicious tag names. Validate tag
  format with regex before use.
- Render formula via python3 reading from env, eliminating YAML+shell
  heredoc indentation pitfalls
- Add concurrency group to serialize concurrent release publishes
- Retry push once with rebase as belt-and-suspenders

* fix: redirect install.sh info/warn to stderr and verify binaries

info() wrote to stdout, corrupting command substitution in
tarball="$(download_tarball ...)". Redirect both info and warn to
stderr. Replace silent `chmod ... || true` with an executable
verification loop so a broken tarball fails loudly.

* fix: require regular file in install.sh binary check
@Kitenite Kitenite deleted the saddlepaddle/homebrew-bump branch April 13, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant