Skip to content

Commit 5b22e63

Browse files
SimplyLizclaude
andcommitted
fix: Re-enable Homebrew upload, add token validation to release workflow
- Re-enable brew formula upload (new HOMEBREW_TAP_TOKEN set) - Add "Validate tokens" step that checks npm and Homebrew tokens before building, failing fast with actionable error messages if expired Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d8d3ed2 commit 5b22e63

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,37 @@ jobs:
3434
node-version: '20'
3535
registry-url: 'https://registry.npmjs.org'
3636

37+
- name: Validate tokens
38+
env:
39+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
40+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
41+
run: |
42+
FAILED=false
43+
44+
# Check npm token
45+
echo "Checking npm token..."
46+
NPM_RESULT=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $NPM_AUTH_TOKEN" https://registry.npmjs.org/-/npm/v1/user)
47+
if [ "$NPM_RESULT" = "200" ]; then
48+
echo "✓ npm token is valid"
49+
else
50+
echo "::error::npm token is invalid or expired (HTTP $NPM_RESULT). Update NPM_AUTH_TOKEN in repo secrets."
51+
FAILED=true
52+
fi
53+
54+
# Check Homebrew tap token
55+
echo "Checking Homebrew tap token..."
56+
BREW_RESULT=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $HOMEBREW_TAP_TOKEN" https://api.github.com/repos/SimplyLiz/homebrew-ckb)
57+
if [ "$BREW_RESULT" = "200" ]; then
58+
echo "✓ Homebrew tap token is valid"
59+
else
60+
echo "::warning::Homebrew tap token is invalid or expired (HTTP $BREW_RESULT). Brew formula upload will be skipped."
61+
fi
62+
63+
if [ "$FAILED" = "true" ]; then
64+
echo "::error::One or more required tokens are invalid. Fix them before releasing."
65+
exit 1
66+
fi
67+
3768
- name: Run tests
3869
run: go test -race ./...
3970

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ brews:
7777
directory: Formula
7878
homepage: "https://github.com/SimplyLiz/CodeMCP"
7979
description: "Code intelligence orchestration layer for AI-assisted development"
80-
skip_upload: true # TODO: re-enable once HOMEBREW_TAP_TOKEN is refreshed
80+
skip_upload: false
8181
install: |
8282
bin.install "ckb"
8383
test: |

0 commit comments

Comments
 (0)