Skip to content

formula: use public download URL instead of API URL with auth#3

Merged
RoxyFarhad merged 1 commit into
mainfrom
RF/remove-auth-from-formula
Mar 7, 2026
Merged

formula: use public download URL instead of API URL with auth#3
RoxyFarhad merged 1 commit into
mainfrom
RF/remove-auth-from-formula

Conversation

@RoxyFarhad
Copy link
Copy Markdown
Contributor

@RoxyFarhad RoxyFarhad commented Mar 7, 2026

Greptile Summary

This PR replaces the authenticated GitHub API asset URL in the Homebrew formula with a standard public release download URL, removing the need for HOMEBREW_GITHUB_API_TOKEN and a separate API call to look up the numeric asset ID.

  • Formula/sgpctl.rb: Drops the API URL (api.github.com/…/releases/assets/<id>) and its Accept, X-GitHub-Api-Version, and Authorization headers in favour of the conventional public URL https://github.com/scaleapi/sgpctl/releases/download/v0.0.1/sgpctl-darwin-arm64.
  • .github/workflows/publish-release.yml: Removes the gh api call that resolved the numeric asset ID and updates the sed replacement to swap out the version path segment (releases/download/v[^/]*/) directly, which is simpler and more robust.

Confidence Score: 5/5

  • This PR is safe to merge — it simplifies the formula and automation without introducing any regressions.
  • Both changes are straightforward and correct: the formula adopts the standard public GitHub release URL (no auth required), and the workflow drops an unnecessary API call in favour of a simpler sed pattern. The sed regex v[^/]*/ correctly matches any semver tag with the conventional v prefix. No logic errors, security issues, or regressions were found.
  • No files require special attention.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Release Event
    participant WF as publish-release workflow
    participant Repo as sgpctl repo (main)

    GH->>WF: release published (TAG)
    WF->>WF: Validate required assets present
    WF->>GH: gh release download sgpctl-darwin-arm64
    WF->>WF: sha256sum artifact
    note over WF: sed replaces releases/download/v*/\nwith releases/download/TAG/\n(no API call for asset ID needed)
    WF->>Repo: commit updated Formula/sgpctl.rb
    WF->>Repo: open PR & squash-merge
Loading

Last reviewed commit: b967fee

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RoxyFarhad RoxyFarhad merged commit 2b84134 into main Mar 7, 2026
3 checks passed
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