ci: add verbose logging to auto-merge workflow for debugging
All checks were successful
Auto-merge docs-only PRs / auto-merge-docs (pull_request) Successful in 2s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-18 23:39:29 -05:00
parent 3fa8374849
commit 4dc8e042f8

View File

@ -48,15 +48,26 @@ jobs:
API_BASE="${{ github.server_url }}/api/v1/repos/${{ github.repository }}/pulls/${PR_NUMBER}"
# Approve the PR
curl -sf -X POST "${API_BASE}/reviews" \
echo "Approving PR #${PR_NUMBER}..."
APPROVE_RESP=$(curl -s -w "\nHTTP_%{http_code}" -X POST "${API_BASE}/reviews" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"event": "APPROVED", "body": "Auto-approved: docs-only changes (all .md files)."}'
-d '{"event": "APPROVED", "body": "Auto-approved: docs-only changes (all .md files)."}')
echo "$APPROVE_RESP"
# Merge the PR
curl -sf -X POST "${API_BASE}/merge" \
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}"'"}'
-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."