Base: codex-main originale (prima del fork aKode)
This commit is contained in:
34
.github/scripts/check_ci_results.py
vendored
Normal file
34
.github/scripts/check_ci_results.py
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Fail a terminal CI job unless every serialized dependency succeeded.
|
||||
|
||||
Parent workflows pass GitHub's `toJSON(needs)` object through the NEEDS
|
||||
environment variable. Treat skipped and cancelled dependencies as failures too:
|
||||
for a required fan-in job, only an explicit success is safe to accept.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
def main() -> None:
|
||||
# Keep result policy in one script so blocking-ci and postmerge-ci cannot
|
||||
# drift in how they interpret dependency conclusions.
|
||||
needs = json.loads(os.environ["NEEDS"])
|
||||
failures = sorted(
|
||||
(name, dependency["result"])
|
||||
for name, dependency in needs.items()
|
||||
if dependency["result"] != "success"
|
||||
)
|
||||
|
||||
if failures:
|
||||
print("CI dependencies did not succeed:")
|
||||
for name, result in failures:
|
||||
print(f"{name}: {result}")
|
||||
raise SystemExit(1)
|
||||
|
||||
print("All CI dependencies succeeded.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user