Skip to content

ci: script the Homebrew formula bump (replace mislav action)#16

Merged
kshahbw merged 1 commit into
mainfrom
scripted-formula-bump
Jun 30, 2026
Merged

ci: script the Homebrew formula bump (replace mislav action)#16
kshahbw merged 1 commit into
mainfrom
scripted-formula-bump

Conversation

@kshahbw

@kshahbw kshahbw commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Why

mislav/bump-homebrew-formula-action resolves the source tarball with a HEAD to GitHub's tarball API (HEAD /repos/{owner}/{repo}/tarball/{ref}). That endpoint started returning HTTP 303 instead of 302 around 2026-05-16, and the action's resolveRedirect only accepts 302 — so every bump now fails deterministically with unexpected HTTP 303 response before the formula is written.

  • Upstream fix is PR #342unmerged (maintainer unresponsive).
  • The action's last release (v4.1, March) predates the break, so no published version helps.
  • Confirmed not isolated to us — also hit php/frankenphp's release workflow (issue #340).

What

Replace the action with a small script in the bump-formula job:

  1. curl -fsSL the source archive (follows any redirect — 302/303/whatever) and compute its sha256. This fetches the same canonical github.com/archive archive brew downloads, so the checksum matches by construction (no "legacy" codeload mismatch the action had to hack around).
  2. Rewrite url + sha256 in Formula/band.rb, keeping the standard github.com/archive URL (audit-clean).
  3. Open the band vX.Y.Z bump PR on the tap.

Re-run safe: force-pushes the bump branch and only opens a PR if one isn't already open. No-ops if the formula is already at the target version. Reuses the existing HOMEBREW_TAP_TOKEN; no new secrets.

Test plan

Shake out on the upcoming v0.2.1-beta cut — confirm it opens a clean tap PR that passes the (now tap-trusted) strict audit.

mislav/bump-homebrew-formula-action resolves the source tarball via a HEAD
to GitHub's tarball API, which started returning HTTP 303 (not 302) around
2026-05-16; the action only accepts 302 and throws 'unexpected HTTP 303'.
The fix (PR #342) is unmerged and the action's last release predates the
break, so every bump now fails deterministically.

Replace it with a small script: curl -L the source archive (follows any
redirect) to compute the sha256, rewrite url + sha256 in the tap formula,
and open the bump PR. curl fetches the same canonical archive brew
downloads, so the checksum matches by construction and the formula keeps
its standard github.com/archive url. Re-run safe via force-push + PR-exists
check.
@kshahbw kshahbw requested review from a team as code owners June 30, 2026 03:54
@bwappsec

bwappsec commented Jun 30, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kshahbw kshahbw merged commit c691279 into main Jun 30, 2026
8 checks passed
@kshahbw kshahbw deleted the scripted-formula-bump branch June 30, 2026 15:20
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.

4 participants