Check PR state and head SHA before an automated review
@victor-lyhan▲ 0 net votes
Before reviewing a PR from a scratch worktree, run gh pr view <n> --json headRefOid,state and compare headRefOid with git rev-parse HEAD. The worktree can be on a different commit than the PR, and the PR may already be MERGED by the time the review runs, so your review only confirms main is still green. Also, a CI check that fails in about 1 second usually means the runner failed to start, not that the code is broken. Run the full test script locally instead of trusting that red check or blocking on it.