Forgejo and Gitea: why the review was refused
When you review a pull request through the API (POST /api/v1/repos/OWNER/REPO/pulls/NUMBER/reviews with event set to APPROVED, REQUEST_CHANGES or COMMENT), Forgejo and Gitea refuse with 422, and the JSON's message says why. All of this is from the source of both (CreatePullReview in routers/api/v1/repo/pull_review.go and SubmitReview in services/pull/review.go), read on October 24, 2026, including the Gitea releases where the wording changed.
422: the answers
approve your own pull is not allowed,reject your own pull is not allowed: you opened this pull request. Neither server lets its author approve it or request changes on it ("reject" is the request for changes). Commenting is allowed.review event REQUEST_CHANGES requires a body: a request for changes needs text inbody. Comments on lines alone are not enough.- A comment with nothing in it:
COMMENTwith an emptybodyand no comments on lines. Forgejo and Gitea up to 1.27 sayreview event COMMENT requires a body or a comment; Gitea 28 and later sayreview requires a body or a comment. can't submit review for a closed or merged PR: Gitea 1.22 and later refuse an approval or a request for changes on a pull request that is closed or merged. Comments are still accepted. Forgejo's source has no such check.- Sending a draft review (
POST …/reviews/ID):only a pending review can be submittedmeans that review was already sent;review stay pendingmeans the request'seventwas notAPPROVED,REQUEST_CHANGESorCOMMENT.
Anyone who can read the repository's code may post a review: on a public repository, any signed-in account. A token that may only read is refused with 403, and the answer says token does not have at least one of required scope(s); see which permission to add. A pull request number that does not exist answers 404; see missing, private or renamed.
Accepted, but it does not count
An approval that went through counts towards the branch's Required approvals only when all of these hold:
- It is official. When the branch's protection rule has Restrict approvals to allowlisted users or teams on (Forgejo says "whitelisted"), only the users and teams on that list count. Otherwise, only accounts with write access to the code count.
- It is not dismissed. With Dismiss stale approvals on, a push that changes what the pull request changes dismisses the approvals. A repository administrator can also dismiss a review.
- It is not stale, when the rule has Ignore stale approvals on. A review is stale when it was made on an earlier commit and the changes have differed since.
Each person's latest approval or request for changes is the one that counts.
Where it stands
curl -H "Authorization: token your-token" https://codeberg.org/api/v1/repos/OWNER/REPO/pulls/42/reviews
Each review has state (APPROVED, REQUEST_CHANGES, COMMENT, PENDING for a draft), commit_id, official, stale and dismissed. The target branch (GET /api/v1/repos/OWNER/REPO/branches/main) has protected and required_approvals. Use your own server's address instead of codeberg.org.
What to do
- Your own pull request: ask someone else to review it. You can still comment.
- requires a body: write what should change, then send the request for changes again.
- Closed or merged (Gitea): leave a comment instead, or reopen the pull request first if the decision still matters.
- It does not count: ask someone with write access, or someone on the allowlist. After new commits, look at them and approve again.
Forgejo and Gitea pull requests in IntelliJ IDEA
Pull Request Inbox for Forgejo and Gitea, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, approves or requests changes on the head commit you had on screen; when the branch has moved since, it sends nothing and says to refresh. Requesting changes asks first what should change, because both servers need it. When the server refuses a review, it shows the server's words, such as "approve your own pull is not allowed"; for a token that may only read, it names the scopes to create the token with. Its merge checks count the official approvals against the number the branch requires, and its list of reviewers marks a review made on an earlier commit. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
Forgejo, Gitea and Codeberg are names of their respective owners; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by the Forgejo project, Codeberg e.V., the Gitea project or JetBrains.
More: Forgejo and Gitea merge refused (405, 409) · "token does not have at least one of required scope(s)" · 401 "token is required" and unknown tokens · 404 "The target couldn't be found." and "not found" · Forgejo and Gitea branch update refused (403, 409, 422) · Forgejo and Gitea pull request not created (409, 422, 403) · Forgejo and Gitea comment refused (403, 422, 400) · Forgejo and Gitea search refused (400, 422) · Forgejo and Gitea pull request files (pages of 50, changed_files) · Forgejo and Gitea pull request plugins for IntelliJ IDEA, compared · 日本語