File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -134,3 +134,5 @@ class Roles:
134
134
(57 , 237 ), # gaia
135
135
(59 , 249 ), # agent-arena
136
136
]
137
+ # GitHub repository URL
138
+ REPO_URL = "https://github.com/inference-labs-inc/omron-subnet"
Original file line number Diff line number Diff line change 5
5
import sys
6
6
import requests
7
7
from typing import Optional
8
+ from constants import REPO_URL
8
9
9
10
from bittensor import logging
10
11
@@ -46,9 +47,7 @@ def get_latest_release_tag(self):
46
47
Get the latest release tag from the GitHub repository
47
48
"""
48
49
try :
49
- response = requests .get (
50
- f"https://api.github.com/repos/inference-labs-inc/omron-subnet/releases/latest"
51
- )
50
+ response = requests .get (f"{ REPO_URL } /releases/latest" )
52
51
response .raise_for_status ()
53
52
latest_release = response .json ()
54
53
return latest_release ["tag_name" ]
@@ -117,11 +116,21 @@ def update_to_latest_release(self) -> bool:
117
116
try :
118
117
119
118
if self .repo .is_dirty (untracked_files = False ):
120
- logging .error (
119
+ logging .warning (
121
120
"Current changeset is dirty. Please commit changes, discard changes or update manually."
122
121
)
123
122
return False
124
123
124
+ if self .repo .head .is_detached :
125
+ logging .warning ("Current branch is detached. Please update manually." )
126
+ return False
127
+
128
+ if self .repo .active_branch .name != TARGET_BRANCH :
129
+ logging .warning (
130
+ f"Current branch is not { TARGET_BRANCH } . Please update manually."
131
+ )
132
+ return False
133
+
125
134
latest_release_tag_name = self .get_latest_release_tag ()
126
135
if not latest_release_tag_name :
127
136
logging .error ("Failed to fetch the latest release tag." )
You can’t perform that action at this time.
0 commit comments