fix(ci): match upstream ci by release sha
This commit is contained in:
@@ -137,29 +137,24 @@ jobs:
|
|||||||
with urllib.request.urlopen(req, timeout=30) as resp:
|
with urllib.request.urlopen(req, timeout=30) as resp:
|
||||||
payload = json.load(resp)
|
payload = json.load(resp)
|
||||||
|
|
||||||
latest_ci = None
|
matched_ci = None
|
||||||
for run in payload.get("workflow_runs", []):
|
for run in payload.get("workflow_runs", []):
|
||||||
path = str(run.get("path") or "")
|
path = str(run.get("path") or "")
|
||||||
if "ci.yml@" not in path:
|
if "ci.yml@" not in path:
|
||||||
continue
|
continue
|
||||||
if run.get("status") != "completed" or run.get("conclusion") != "success":
|
if run.get("status") != "completed" or run.get("conclusion") != "success":
|
||||||
continue
|
continue
|
||||||
latest_ci = run
|
actual_sha = str(run.get("head_sha") or "")
|
||||||
|
if actual_sha != expected_sha:
|
||||||
|
continue
|
||||||
|
matched_ci = run
|
||||||
break
|
break
|
||||||
|
|
||||||
if not latest_ci:
|
if not matched_ci:
|
||||||
print("ERROR: No successful ci.yml run found in recent history")
|
print("ERROR: No successful ci.yml run found for the release SHA")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
actual_sha = str(latest_ci.get("head_sha") or "")
|
print(f"✓ Upstream CI verified: {expected_sha} (run {matched_ci.get('id')})")
|
||||||
if actual_sha != expected_sha:
|
|
||||||
print("ERROR: Latest successful ci.yml SHA does not match upstream release SHA")
|
|
||||||
print(f"Expected: {expected_sha}")
|
|
||||||
print(f"Actual: {actual_sha}")
|
|
||||||
print(f"Run ID: {latest_ci.get('id')}")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
print(f"✓ Upstream CI verified: {actual_sha} (run {latest_ci.get('id')})")
|
|
||||||
PY
|
PY
|
||||||
|
|
||||||
- name: Download Release Artifact
|
- name: Download Release Artifact
|
||||||
|
|||||||
Reference in New Issue
Block a user