(res: SelectorResult)
| 844 | |
| 845 | |
| 846 | def write_github_output(res: SelectorResult) -> None: |
| 847 | out_path = os.environ.get("GITHUB_OUTPUT") |
| 848 | if not out_path: |
| 849 | raise RuntimeError("GITHUB_OUTPUT is not set") |
| 850 | |
| 851 | def j(v) -> str: |
| 852 | return json.dumps(v, separators=(",", ":"), ensure_ascii=False) |
| 853 | |
| 854 | selected_workflows = _enabled_lane_names(res) |
| 855 | |
| 856 | with open(out_path, "a", encoding="utf-8") as f: |
| 857 | f.write(f"run_skip={str(res.lanes.skip).lower()}\n") |
| 858 | f.write(f"run_docs={str(res.lanes.docs).lower()}\n") |
| 859 | f.write(f"run_fast={str(res.lanes.fast).lower()}\n") |
| 860 | f.write(f"run_full={str(res.lanes.full).lower()}\n") |
| 861 | f.write(f"selected_workflows={j(selected_workflows)}\n") |
| 862 | f.write(f"lane_reasons={j(res.lane_reasons)}\n") |
| 863 | f.write(f"diff_mode={res.diff_mode.value}\n") |
| 864 | f.write(f"pytest_paths={j(res.pytest_paths)}\n") |
| 865 | f.write(f"functional_scripts={j(res.functional_scripts)}\n") |
| 866 | f.write(f"reasons={j(res.reasons)}\n") |
| 867 | f.write(f"changed_files={j(res.changed_files)}\n") |
| 868 | f.write(f"provenance={j(res.provenance.model_dump())}\n") |
| 869 | |
| 870 | |
| 871 | def main(argv: Sequence[str] | None = None) -> int: |
no test coverage detected