also looking at this
fix(review): read what publishing reported, honour reviewSuggestions, and un-strand two flags
#1435
5 files
+267
-10
| @@ -1645,6 +1645,10 @@ cli | ||
| 1645 | 1645 | // `--auto` is what the generated workflow passes. Without it this is |
| 1646 | 1646 | // someone at a terminal, who has already decided they want a review. |
| 1647 | 1647 | trigger: options.auto ? 'automatic' : 'requested', |
| 1648 | // The workflow fires on every edited event, so without this the | |
| 1649 | // same head commit would be reviewed again each time the PR body | |
| 1650 | // changes. A person re-running the command still gets their review. | |
| 1651 | ...(options.auto ? { skipIfReviewed: true } : {}), | |
| 1648 | 1652 | logger: log, |
| 1649 | 1653 | dryRun: Boolean(options.dryRun), |
| 1650 | 1654 | ...(options.summaryOnly ? { summaryOnly: true } : {}), |
| @@ -1707,6 +1711,14 @@ cli | ||
| 1707 | 1711 | |
| 1708 | 1712 | process.stdout.write(formatReview(result, format)) |
| 1709 | 1713 | |
| 1714 | // `--fix` was accepted here and silently ignored: the light branch | |
| 1715 | // returned before the block that applies suggestions, so the flag | |
| 1716 | // worked everywhere except the one mode fast enough for a hook. | |
| 1717 | if (options.fix) { | |
| 1718 | const applied = await applyFixes(result.findings, Boolean(options.yes), logger) | |
| 1719 | logger.success(`\u{1f527} Applied ${applied} suggestion(s)`) | |
| 1720 | } | |
| 1721 | ||
| 1710 | 1722 | if (options.failOn && shouldFail(result.findings, options.failOn as 'critical')) |
| 1711 | 1723 | process.exit(1) |
| 1712 | 1724 | return |