Match verified main workflows using Gitea run path metadata
Gitea CI / Windows x64 and Android (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s

This commit is contained in:
lingjhf committed 2026-10-06 03:13:28 +08:00
1 parent 2fb675e64c
commit d648033f03
1 file changed
+1 -1
+1 -1
View File
@@ -43,7 +43,7 @@ def main():
if tag != f'v{version}':
raise ValueError('Release tag must match pubspec version')
runs = request(f'{BASE}/actions/runs?limit=100')['workflow_runs']
matches = [run for run in runs if run['head_sha'] == sha and run['head_branch'] == 'main' and run['conclusion'] == 'success' and run['name'] == 'Gitea CI']
matches = [run for run in runs if run['head_sha'] == sha and run['path'].endswith('@refs/heads/main') and run['conclusion'] == 'success' and Path(run['path'].split('@')[0]).name == 'ci.yml']
if not matches:
raise ValueError('No successful main CI for this exact commit; run CI before releasing')
run = max(matches, key=lambda item: item['id'])