Skip to content

Commit c75d111

Browse files
abizerclaude
andcommitted
ci: bump cask via brew bump-cask-pr --write-only --commit
Homebrew's own cask bumper understands Ruby #{version} interpolation in url stanzas (which brew audit requires). mislav's JS action does not — it parses the cask as plain text, sees "v#{version}" in the existing url, treats it as the current version string, and skips bumps that appear to match. --write-only --commit lets brew commit the bump locally without opening a PR; we then push directly to master via the TAP_TOKEN PAT. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f5ec4a9 commit c75d111

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,31 @@ jobs:
4848
--title "v${VERSION}" \
4949
--generate-notes
5050
51-
# download-url contains a literal Ruby interpolation (#{version}) so the
52-
# cask's url stanza retains it — otherwise brew audit flags the URL as
53-
# unversioned. Ruby evaluates #{version} at cask load time.
51+
# brew bump-cask-pr is Homebrew's canonical cask bumper — preserves
52+
# #{version} interpolation in the url stanza (unlike mislav's JS action,
53+
# which parses the cask as plain text). --write-only --commit makes it
54+
# commit locally without opening a PR; we push the commit ourselves.
55+
- uses: Homebrew/actions/setup-homebrew@main
5456
- name: Bump homebrew cask
55-
uses: mislav/bump-homebrew-formula-action@v4
56-
with:
57-
formula-name: wtop
58-
formula-path: Casks/wtop.rb
59-
homebrew-tap: abizer/homebrew-tap
60-
base-branch: master
61-
download-url: 'https://github.com/abizer/wtop/releases/download/v#{version}/wtop.app.zip'
62-
download-sha256: ${{ steps.sha.outputs.sha256 }}
63-
commit-message: "wtop {{version}}"
6457
env:
65-
COMMITTER_TOKEN: ${{ secrets.TAP_TOKEN }}
58+
TAP_TOKEN: ${{ secrets.TAP_TOKEN }}
59+
HOMEBREW_NO_INSTALL_FROM_API: "1"
60+
run: |
61+
VERSION="${{ steps.version.outputs.version }}"
62+
SHA="${{ steps.sha.outputs.sha256 }}"
63+
64+
brew tap abizer/homebrew-tap
65+
tap_repo="$(brew --repository abizer/homebrew-tap)"
66+
cd "$tap_repo"
67+
git remote set-url origin "https://x-access-token:${TAP_TOKEN}@github.com/abizer/homebrew-tap.git"
68+
git config user.name "github-actions[bot]"
69+
git config user.email "github-actions[bot]@users.noreply.github.com"
70+
71+
brew bump-cask-pr \
72+
--write-only --commit \
73+
--no-audit --no-style \
74+
--version="${VERSION}" \
75+
--sha256="${SHA}" \
76+
abizer/tap/wtop
77+
78+
git push origin HEAD:master

0 commit comments

Comments
 (0)