Files
devx/docs/specs/DEVX-161.md
T
emilandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> c3d1f630db
CI / validate (pull_request) Successful in 1m5s
CI / auto-merge (pull_request) Successful in 27s
fix: fall back to CI bot token for auto-merge approval
REVIEWER_GITEA_API_TOKEN is the same user as the PR creator, causing
self-approval rejection. Now tries REVIEWER first, then falls back to
CI_GITEA_API_TOKEN (kireto — CI bot account).

Closes DEVX-161

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-26 09:55:27 +02:00

886 B

DEVX-161: Fix auto-merge self-approval: use CI bot token fallback

Problem

The auto-merge workflow posts an APPROVE review using REVIEWER_GITEA_API_TOKEN. When this token belongs to the same user who created the PR, Gitea rejects the self-approval, causing the merge to fail with HTTP 405 "Does not have enough approvals."

Approach

Try REVIEWER_GITEA_API_TOKEN first; if it fails (self-approval rejection), fall back to CI_GITEA_API_TOKEN (kireto — CI bot account).

REQ-1: Auto-merge posts approval with fallback to CI bot token REQ-2: Approval step reports which token succeeded

Test Plan

  • Create a PR and observe auto-merge succeeds

Deploy Plan

  • Merge to master

Rollback Plan

  • Revert the merge commit

Acceptance Criteria

  • REQ-1: Auto-merge posts approval with fallback to CI bot token
  • REQ-2: Approval step reports which token succeeded