@@ -79,7 +79,6 @@ def _build_contribution_graph_from_git(repo_path: str = ".") -> list:
7979 result = subprocess .run (
8080 ['git' , 'log' , '--pretty=format:%ai' , '--all' ],
8181 capture_output = True , text = True , cwd = repo_path ,
82- env = {** os .environ , 'GH_TOKEN' : os .getenv ('GH_TOKEN' )}
8382 )
8483 if result .returncode != 0 :
8584 return []
@@ -217,7 +216,7 @@ def _gh_api(self, endpoint: str, method: str = "GET") -> Any:
217216 capture_output = True ,
218217 text = True ,
219218 timeout = 30 ,
220- env = {** os . environ , 'GH_TOKEN' : os . getenv ( 'GH_TOKEN' ) }
219+ env = {'GH_TOKEN' : self . token } if self . token != None else { }
221220 )
222221 if result .returncode != 0 :
223222 raise Exception (f"gh api failed: { result .stderr } " )
@@ -442,7 +441,7 @@ def _search_items(self, query: str, per_page: int = 5) -> Dict[str, Any]:
442441 capture_output = True ,
443442 text = True ,
444443 timeout = 30 ,
445- env = {** os . environ , 'GH_TOKEN' : os . getenv ( 'GH_TOKEN' ) }
444+ env = {'GH_TOKEN' : self . token } if self . token != None else { }
446445 )
447446 if result .returncode != 0 :
448447 return {'total_count' : 0 , 'items' : []}
@@ -554,7 +553,7 @@ def _fetch_contribution_graph(self, username: str) -> list:
554553 capture_output = True ,
555554 text = True ,
556555 timeout = 30 ,
557- env = {** os . environ , 'GH_TOKEN' : os . getenv ( 'GH_TOKEN' ) }
556+ env = {'GH_TOKEN' : self . token } if self . token != None else { }
558557 )
559558
560559 if result .returncode != 0 :
@@ -647,7 +646,6 @@ def _api_request(self, endpoint: str) -> Any:
647646 capture_output = True ,
648647 text = True ,
649648 timeout = 30 ,
650- env = {** os .environ , 'GH_TOKEN' : os .getenv ('GH_TOKEN' )}
651649 )
652650 if result .returncode != 0 :
653651 raise Exception (f"API request failed: { result .stderr } " )
0 commit comments