#!/usr/bin/env python3 """Read .release/current JSON from stdin and write GitHub Actions outputs.""" from __future__ import annotations import json import os import sys def main() -> int: raw = sys.stdin.read().strip() data = json.loads(raw) if raw else {} current = data.get("current") or "" previous = data.get("previous") or "" output_path = os.environ["GITHUB_OUTPUT"] with open(output_path, "a", encoding="utf-8") as handle: handle.write(f"live_current={current}\n") handle.write(f"live_previous={previous}\n") print( "Pointer live current=" + (current or "") + " previous=" + (previous or "") ) return 0 if __name__ == "__main__": raise SystemExit(main())