A draft pull request shares unfinished work: it cannot be merged, and code owners (CODEOWNERS) are asked for review only when it is marked ready. Sam opens issue #5's documentation as a draft (#8), tries to merge it, marks it ready and requests a reviewer:
gh pr create --draft --title "Document the error responses" --body-file pr-errors.md \
--label documentation --milestone 1.2.0
gh pr merge 8 --merge
gh pr ready 8
gh api -X POST repos/{owner}/{repo}/pulls/8/requested_reviewers -f 'reviewers[]=binarybehemoth'Output
https://github.com/binarybehemoth/booknest/pull/8
GraphQL: Pull Request is still a draft (mergePullRequest)
✓ Pull request binarybehemoth/booknest#8 is marked as "ready for review"
{"message":"Review cannot be requested from pull request author.",...,"status":"422"}
gh: Review cannot be requested from pull request author. (HTTP 422)Nobody reviews their own pull request. On a team, Sam would request a colleague with read access or more, with gh 29 pr edit 8 --add-reviewer <login> or the Reviewers gear; for his own login that command silently did nothing, while REST shows the refusal.