INNER CODE UNIT · Python

main

joreilly/Confetti · .github/scripts/ios-changes.py:176

def main() -> int:
    if len(sys.argv) != 3:
        print(f"usage: {Path(sys.argv[0]).name} BASE_REVISION HEAD_REVISION", file=sys.stderr)
        return 2

    try:
        affects_ios, reason = classify(sys.argv[1], sys.argv[2])
    except subprocess.CalledProcessError as error:
        # A missing revision or unexpected git failure must never silently skip CI.
        affects_ios, reason = True, f"could not inspect changes safely ({error})"

    value = str(affects_ios).lower()
    print(f"ios={value}")
    print(f"iOS CI decision: {value} ({reason})")
    if output_file := os.environ.get("GITHUB_OUTPUT"):
        with open(output_file, "a", encoding="utf-8") as output:
            output.write(f"ios={value}\n")
    return 0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…