fix(ci): drop PAT approval, use github.token for auto-merge only

PAT_TOKEN_2 does not have the scope required for PR reviews
(addPullRequestReview). Since github.token cannot approve its own PR,
drop the approval step entirely and just enable auto-merge.

If branch protection requires a review the PR will still be created and
auto-merged as soon as a maintainer approves it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro 2026-02-19 21:16:52 -03:00
parent 41776b0382
commit adb3670455

View file

@ -72,12 +72,9 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
- name: Approve and enable auto-merge
- name: Enable auto-merge
if: steps.diff.outputs.changed == 'true'
run: |
# Approve with PAT_TOKEN_2 (a different identity from the creator,
# since GitHub does not allow a token to approve its own PR).
gh pr review "${{ steps.open-pr.outputs.pr_url }}" --approve
gh pr merge "${{ steps.open-pr.outputs.pr_url }}" --auto --squash
gh pr merge "${{ steps.open-pr.outputs.pr_url }}" --auto --squash
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN_2 }}
GH_TOKEN: ${{ github.token }}