Skip to content

Commit 5cc9580

Browse files
committed
Enhance Homebrew formula update process in GitHub Actions workflow
- Added a step to commit and push changes to the tap repository after formula creation. - Implemented a check to avoid committing if there are no changes. - Improved logging for successful commits and pushes.
1 parent c2ee697 commit 5cc9580

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,24 @@ jobs:
243243
# Create formula file
244244
printf 'class Mcpproxy < Formula\n desc "Smart MCP Proxy - Intelligent tool discovery and proxying for Model Context Protocol servers"\n homepage "https://github.com/smart-mcp-proxy/mcpproxy-go"\n url "https://github.com/smart-mcp-proxy/mcpproxy-go/archive/refs/tags/v%s.tar.gz"\n sha256 "%s"\n license "MIT"\n head "https://github.com/smart-mcp-proxy/mcpproxy-go.git"\n\n depends_on "go" => :build\n\n def install\n system "go", "build", "-ldflags", "-s -w", "-o", "mcpproxy", "./cmd/mcpproxy"\n bin.install "mcpproxy"\n end\n\n test do\n assert_match version.to_s, shell_output("#{bin}/mcpproxy --version")\n end\nend\n' "${VERSION}" "${SOURCE_SHA}" > Formula/mcpproxy.rb
245245
246-
echo "Formula created successfully"
246+
echo "Formula created successfully"
247247
cat Formula/mcpproxy.rb
248248
249249
# Clean up
250250
rm -f *.tar.gz
251+
252+
- name: Commit and push changes
253+
run: |
254+
cd tap
255+
git config user.name "github-actions[bot]"
256+
git config user.email "github-actions[bot]@users.noreply.github.com"
257+
git add Formula/mcpproxy.rb
258+
259+
# Check if there are changes to commit
260+
if git diff --staged --quiet; then
261+
echo "No changes to commit"
262+
else
263+
git commit -m "Update mcpproxy to ${GITHUB_REF#refs/tags/v}"
264+
git push
265+
echo "Changes committed and pushed successfully"
266+
fi

0 commit comments

Comments
 (0)