Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,33 @@ jobs:

- name: Push to Homebrew tap
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
git clone https://x-access-token:${GITHUB_TOKEN}@github.com/harmony-labs/homebrew-tap.git tap
VERSION="${{ steps.version.outputs.version }}"
BRANCH="update-meta-cli-${VERSION}"

gh repo clone harmony-labs/homebrew-tap tap
mkdir -p tap/Formula
cp meta-cli.rb tap/Formula/
Comment thread
mateodelnorte marked this conversation as resolved.
cd tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/meta-cli.rb
git commit -m "Update meta-cli to v${{ steps.version.outputs.version }}"
git push
if ! git diff --cached --quiet; then
git checkout -b "$BRANCH"
git commit -m "Update meta-cli to v${VERSION}"
# Force push in case branch exists from a previous failed run
git push -f -u origin "$BRANCH"
# Create PR only if one doesn't already exist
if ! gh pr view "$BRANCH" --repo harmony-labs/homebrew-tap &>/dev/null; then
gh pr create \
--title "Update meta-cli to v${VERSION}" \
--body "Automated formula update from meta release v${VERSION}." \
--repo harmony-labs/homebrew-tap
fi
gh pr merge "$BRANCH" \
--auto --squash \
--repo harmony-labs/homebrew-tap || echo "Auto-merge setup failed (may require approvals)"
else
echo "Formula unchanged, skipping commit"
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.