ci: remove approval step from auto-merge workflow
All checks were successful
Auto-merge docs-only PRs / auto-merge-docs (pull_request) Successful in 2s

Approval fails with "approve your own pull is not allowed" since
the token belongs to the repo owner. Merge works without it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-18 23:42:36 -05:00
parent 230a35b8dd
commit bc99bcdf4d

View File

@ -39,7 +39,7 @@ jobs:
echo "docs_only=${DOCS_ONLY}" >> "$GITHUB_OUTPUT"
- name: Approve and merge
- name: Auto-merge
if: steps.check.outputs.docs_only == 'true'
env:
GITEA_TOKEN: ${{ secrets.AUTO_MERGE_TOKEN }}
@ -47,27 +47,9 @@ jobs:
PR_NUMBER=${{ github.event.pull_request.number }}
API_BASE="${{ github.server_url }}/api/v1/repos/${{ github.repository }}/pulls/${PR_NUMBER}"
# Approve the PR
echo "Approving PR #${PR_NUMBER}..."
APPROVE_RESP=$(curl -s -w "\nHTTP_%{http_code}" -X POST "${API_BASE}/reviews" \
curl -sf -X POST "${API_BASE}/merge" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"event": "APPROVED", "body": "Auto-approved: docs-only changes (all .md files)."}')
echo "$APPROVE_RESP"
-d '{"Do": "merge", "merge_message_field": "Auto-merge: docs-only PR #'"${PR_NUMBER}"'"}'
# Merge the PR
echo "Merging PR #${PR_NUMBER}..."
MERGE_RESP=$(curl -s -w "\nHTTP_%{http_code}" -X POST "${API_BASE}/merge" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"Do": "merge", "merge_message_field": "Auto-merge: docs-only PR #'"${PR_NUMBER}"'"}')
echo "$MERGE_RESP"
# Check for failure
HTTP_CODE=$(echo "$MERGE_RESP" | tail -1)
if [[ "$HTTP_CODE" =~ HTTP_4[0-9][0-9] || "$HTTP_CODE" =~ HTTP_5[0-9][0-9] ]]; then
echo "Merge failed!"
exit 1
fi
echo "PR #${PR_NUMBER} auto-approved and merged."
echo "PR #${PR_NUMBER} auto-merged."