Skip to content

Commit f5ec4a9

Browse files
abizerclaude
andcommitted
ci: bump cask via mislav action with v#{version} interpolation preserved
Pass the download-url with a literal Ruby #{version} interpolation so the action writes it verbatim into the cask's url stanza. Ruby evaluates it at cask load time. Avoids brew audit's "URL is unversioned" false-positive without giving up the action. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d77c027 commit f5ec4a9

1 file changed

Lines changed: 17 additions & 24 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
- name: Create zip
3636
run: ditto -c -k --keepParent wtop.app wtop.app.zip
3737

38+
- name: Compute sha256
39+
id: sha
40+
run: echo "sha256=$(shasum -a 256 wtop.app.zip | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
41+
3842
- name: Create GitHub Release
3943
env:
4044
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -44,29 +48,18 @@ jobs:
4448
--title "v${VERSION}" \
4549
--generate-notes
4650
47-
# Mislav's action rewrites the url stanza to a literal version, which
48-
# trips brew audit's "URL is unversioned" rule. Hand-rolled sed preserves
49-
# the v#{version} interpolation in the cask.
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.
5054
- 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}}"
5164
env:
52-
TAP_TOKEN: ${{ secrets.TAP_TOKEN }}
53-
run: |
54-
VERSION="${{ steps.version.outputs.version }}"
55-
SHA=$(shasum -a 256 wtop.app.zip | cut -d' ' -f1)
56-
57-
git clone "https://x-access-token:${TAP_TOKEN}@github.com/abizer/homebrew-tap.git" tap
58-
cd tap
59-
60-
sed -i '' "s|version \"[0-9]*\.[0-9]*\.[0-9]*\"|version \"${VERSION}\"|" Casks/wtop.rb
61-
sed -i '' "s|sha256 \"[a-f0-9]*\"|sha256 \"${SHA}\"|" Casks/wtop.rb
62-
63-
if git diff --quiet Casks/wtop.rb; then
64-
echo "cask already up to date for v${VERSION}"
65-
exit 0
66-
fi
67-
68-
git config user.name "github-actions[bot]"
69-
git config user.email "github-actions[bot]@users.noreply.github.com"
70-
git add Casks/wtop.rb
71-
git commit -m "wtop ${VERSION}"
72-
git push
65+
COMMITTER_TOKEN: ${{ secrets.TAP_TOKEN }}

0 commit comments

Comments
 (0)