Skip to content

Commit 8716786

Browse files
nsheapsclaude
andcommitted
fix: create PR instead of pushing directly to homebrew-devsetup
The homebrew-devsetup repo has branch protection requiring PRs. Co-Authored-By: Claude Code (User Settings, in: ${CLAUDE_PROJECT_DIR}) <noreply@anthropic.com>
1 parent 917d5e4 commit 8716786

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/release.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ jobs:
5151
- name: Update formula
5252
run: |
5353
cd homebrew-devsetup
54-
55-
cat > Formula/worktree-switcher.rb << 'FORMULA_EOF'
54+
cat > Formula/worktree-switcher.rb << FORMULA_EOF
5655
# typed: false
5756
# frozen_string_literal: true
5857
@@ -85,10 +84,18 @@ jobs:
8584
end
8685
end
8786
FORMULA_EOF
87+
# Remove leading whitespace from heredoc
88+
sed -i 's/^ //' Formula/worktree-switcher.rb
8889
89-
- name: Commit and push formula update
90+
- name: Create PR to update formula
9091
run: |
9192
cd homebrew-devsetup
93+
BRANCH="bump-worktree-switcher-${{ steps.release.outputs.version }}"
94+
git checkout -b "$BRANCH"
9295
git add Formula/worktree-switcher.rb
93-
git commit -m "chore: update worktree-switcher to ${{ steps.release.outputs.version }}" || exit 0
94-
git push
96+
git commit -m "chore: update worktree-switcher to ${{ steps.release.outputs.version }}"
97+
git push -u origin "$BRANCH"
98+
gh pr create \
99+
--title "chore: update worktree-switcher to ${{ steps.release.outputs.version }}" \
100+
--body "Automated formula update from git-wt release ${{ steps.release.outputs.tag }}" \
101+
--base main

0 commit comments

Comments
 (0)