diff --git a/tool/gitea/promote-release.py b/tool/gitea/promote-release.py index 058c8ad..9abb486 100644 --- a/tool/gitea/promote-release.py +++ b/tool/gitea/promote-release.py @@ -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'])