| 625 | |
| 626 | |
| 627 | def _emit_github_output(mode: str, count: int) -> None: |
| 628 | if mode not in {"all", "subset", "none"}: |
| 629 | raise ValueError(f"invalid selection mode: {mode!r}") |
| 630 | if not isinstance(count, int) or count < 0: |
| 631 | raise ValueError(f"invalid selection count: {count!r}") |
| 632 | gh_out = os.environ.get("GITHUB_OUTPUT") |
| 633 | if not gh_out: |
| 634 | return |
| 635 | with open(gh_out, "a", encoding="utf-8") as fh: |
| 636 | fh.write(f"mode={mode}\n") |
| 637 | fh.write(f"count={count}\n") |
| 638 | |
| 639 | |
| 640 | def _resolve_output_path(trusted_root: Path, value: str) -> Path: |