Match verified main workflows using Gitea run path metadata
This commit is contained in:
1 parent
2fb675e64c
commit
d648033f03
1 file changed
+1
-1
@@ -43,7 +43,7 @@ def main():
|
|||||||
if tag != f'v{version}':
|
if tag != f'v{version}':
|
||||||
raise ValueError('Release tag must match pubspec version')
|
raise ValueError('Release tag must match pubspec version')
|
||||||
runs = request(f'{BASE}/actions/runs?limit=100')['workflow_runs']
|
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:
|
if not matches:
|
||||||
raise ValueError('No successful main CI for this exact commit; run CI before releasing')
|
raise ValueError('No successful main CI for this exact commit; run CI before releasing')
|
||||||
run = max(matches, key=lambda item: item['id'])
|
run = max(matches, key=lambda item: item['id'])
|
||||||
|
|||||||
Reference in new issue
Block a user