Skip to content

Commit 82a12cb

Browse files
committed
fix: make PR creation optional, don't fail workflow if not permitted
1 parent 2b6887b commit 82a12cb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,17 @@ jobs:
9999
git commit -m "chore: update homebrew formula to ${{ steps.release.outputs.version }}"
100100
git push origin "$BRANCH_NAME"
101101
102-
# Create PR using GitHub CLI
103-
gh pr create --title "chore: update homebrew formula to ${{ steps.release.outputs.version }}" \
102+
# Create PR using GitHub CLI (may fail if Actions doesn't have PR permissions)
103+
# To enable: Settings → Actions → General → Workflow permissions → Allow GitHub Actions to create and approve pull requests
104+
if gh pr create --title "chore: update homebrew formula to ${{ steps.release.outputs.version }}" \
104105
--body "Automated PR to update Homebrew formula for release ${{ steps.release.outputs.version }}" \
105106
--base master \
106-
--head "$BRANCH_NAME"
107+
--head "$BRANCH_NAME"; then
108+
echo "✅ PR created successfully"
109+
else
110+
echo "⚠️ Could not create PR automatically. Please create PR manually from branch: $BRANCH_NAME"
111+
echo " Or enable PR creation in Settings → Actions → General → Workflow permissions"
112+
fi
107113
fi
108114
env:
109115
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)