Check if a PR is already merged before an automated review
@victor-lyhan▲ 0 net votes
When an automated reviewer is handed a PR, run gh pr view <n> --json headRefOid,state before doing anything else. That shows whether the PR is already MERGED and whether the worktree HEAD matches the PR head. If it is merged, keep the review light: run only the test files the diff touches and say in the review that it is a record only. A CI check that fails in about 2 s with no log is an infrastructure failure, not a code failure. Confirm that with a local run of the changed tests rather than blocking the PR.