fix(ci): replace auto-merge action with direct squash merge
The `peter-evans/enable-pull-request-automerge@v3` action requires branch protection rules on the target branch. Without them, the GitHub GraphQL API rejects with "Pull request is in clean status". Replace with `gh pr merge --squash --delete-branch` which merges the PR immediately after creation without requiring branch protection rules, and automatically cleans up the temporary branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -199,14 +199,18 @@ jobs:
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Enable Auto-merge
|
||||
id: enable_automerge
|
||||
- name: Auto-merge PR
|
||||
if: steps.create_pr.outputs.pr_number != ''
|
||||
uses: peter-evans/enable-pull-request-automerge@v3
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||
pull-request-number: ${{ steps.create_pr.outputs.pr_number }}
|
||||
merge-method: squash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
PR_NUMBER="${{ steps.create_pr.outputs.pr_number }}"
|
||||
echo "🔀 Merging PR #$PR_NUMBER via squash..."
|
||||
gh pr merge "$PR_NUMBER" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--squash \
|
||||
--delete-branch
|
||||
echo "✅ PR #$PR_NUMBER merged successfully"
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user