diff --git a/README.md b/README.md index 84f3057..3b6b1b0 100644 --- a/README.md +++ b/README.md @@ -304,7 +304,7 @@ said, and is where a repo puts the paths it always wants eyes on. Each run adds a review; GitHub reviews are appended, not edited, so a PR with ten pushes carries ten of them, and the newest is the one that describes the -head commit. REQUEST_CHANGES and APPROVE change the PR's state; the two +head commit. REQUEST_CHANGES and APPROVE change the PR's state; the COMMENT outcomes do not. Nothing is submitted when the reviewer crashed, on purpose: a changes-requested diff --git a/review/submit-verdict.mjs b/review/submit-verdict.mjs index af3d398..97e805a 100644 --- a/review/submit-verdict.mjs +++ b/review/submit-verdict.mjs @@ -312,6 +312,10 @@ try { 'Nothing blocks and no human review is needed.', ]); } catch (error) { + // Only a refusal falls back. A request that got no answer (the 15s + // timeout, a dropped connection) may have created the review anyway, + // and commenting then would dismiss the approval that landed. + if (!/HTTP 422/.test(error.message)) throw error; console.log(`::warning::could not approve: ${escapeData(error.message)}`); approveHint(error); const own = await submit('COMMENT', [