Skip to content

Commit c934727

Browse files
committed
fix: create PR for homebrew formula update instead of direct push
1 parent d8b9f28 commit c934727

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,23 @@ jobs:
8282
git config --local user.email "action@github.com"
8383
git config --local user.name "GitHub Action"
8484
85+
# Create a new branch for the formula update
86+
BRANCH_NAME="homebrew-${{ steps.release.outputs.version }}"
87+
git checkout -b "$BRANCH_NAME"
88+
8589
git add Formula/agentx.rb
8690
8791
if git diff --staged --quiet; then
8892
echo "No changes to commit"
8993
else
9094
git commit -m "chore: update homebrew formula to ${{ steps.release.outputs.version }}"
91-
git push origin HEAD:master
95+
git push origin "$BRANCH_NAME"
96+
97+
# Create PR using GitHub CLI
98+
gh pr create --title "chore: update homebrew formula to ${{ steps.release.outputs.version }}" \
99+
--body "Automated PR to update Homebrew formula for release ${{ steps.release.outputs.version }}" \
100+
--base master \
101+
--head "$BRANCH_NAME"
92102
fi
103+
env:
104+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)