mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 18:33:12 +00:00
30 lines
769 B
Python
30 lines
769 B
Python
|
|
#!/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 "<empty>")
|
||
|
|
+ " previous="
|
||
|
|
+ (previous or "<empty>")
|
||
|
|
)
|
||
|
|
return 0
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
raise SystemExit(main())
|