#!/usr/bin/env python3
"""
Tiny shared IO helpers for ios-native-testflight scripts.

Kept deliberately minimal so that read_config.py and lookup_app_id.py can
import without pulling in heavier dependencies (PyYAML, requests, PyJWT).
"""

from __future__ import annotations

import sys


def log(msg: str) -> None:
    """Debug log to stderr (never contains .p8 contents)."""
    print(msg, file=sys.stderr)


def notice(msg: str) -> None:
    """GitHub Actions workflow-command notice."""
    print(f"::notice::{msg}")


def fail(msg: str) -> str:
    """Emit a GitHub Actions workflow-command error and exit 1."""
    print(f"::error::{msg}", file=sys.stderr)
    raise SystemExit(1)
